summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WTF/WTF.pri1
-rw-r--r--Source/WTF/wtf/RetainPtr.h2
-rw-r--r--Source/WebCore/WebCore.pri4
-rw-r--r--Source/WebCore/page/FrameView.cpp43
-rw-r--r--Source/WebCore/page/FrameView.h19
-rw-r--r--Source/WebCore/platform/FileSystem.h4
-rw-r--r--Source/WebCore/platform/qt/FileSystemQt.cpp2
-rw-r--r--Source/WebCore/plugins/mac/PluginPackageMac.cpp8
-rw-r--r--Source/WebCore/plugins/mac/PluginViewMac.mm3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
10 files changed, 62 insertions, 26 deletions
diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
index 2697d7720..a9a950012 100644
--- a/Source/WTF/WTF.pri
+++ b/Source/WTF/WTF.pri
@@ -16,6 +16,7 @@ mac {
} else {
contains(QT_CONFIG,icu) {
win32: LIBS += -licuin -licuuc -licudt
+ else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n"): PKGCONFIG *= icu-i18n
else:android: LIBS += -licui18n -licuuc
else: LIBS += -licui18n -licuuc -licudata
}
diff --git a/Source/WTF/wtf/RetainPtr.h b/Source/WTF/wtf/RetainPtr.h
index 26997283d..6927e9040 100644
--- a/Source/WTF/wtf/RetainPtr.h
+++ b/Source/WTF/wtf/RetainPtr.h
@@ -77,7 +77,7 @@ namespace WTF {
RetainPtr(AdoptCFTag, PtrType ptr)
: m_ptr(ptr)
{
-#ifdef __OBJC__
+#if defined(__OBJC__) && defined(__cplusplus) && __cplusplus >= 201103L
static_assert((!std::is_convertible<T, id>::value), "Don't use adoptCF with Objective-C pointer types, use adoptNS.");
#endif
}
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index 28dae593a..2675a310d 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -112,7 +112,7 @@ INCLUDEPATH += $$WEBCORE_GENERATED_SOURCES_DIR
enable?(XSLT) {
use?(LIBXML2) {
mac {
- INCLUDEPATH += /usr/include/libxslt /usr/include/libxml2
+ QMAKE_CXXFLAGS += -iwithsysroot /usr/include/libxslt -iwithsysroot /usr/include/libxml2
LIBS += -lxml2 -lxslt
} else {
PKGCONFIG += libxslt libxml-2.0
@@ -277,7 +277,7 @@ win32 {
}
# Remove whole program optimizations due to miscompilations
-win32-msvc2005|win32-msvc2008|win32-msvc2010|win32-msvc2012|wince*:{
+win32-msvc2005|win32-msvc2008|win32-msvc2010|win32-msvc2012|win32-msvc2013|wince*:{
QMAKE_CFLAGS_LTCG -= -GL
QMAKE_CXXFLAGS_LTCG -= -GL
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 4823b48d0..56698c73b 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -174,6 +174,7 @@ FrameView::FrameView(Frame* frame)
, m_canHaveScrollbars(true)
, m_layoutTimer(this, &FrameView::layoutTimerFired)
, m_layoutRoot(0)
+ , m_layoutPhase(OutsideLayout)
, m_inSynchronousPostLayout(false)
, m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
, m_isTransparent(false)
@@ -275,8 +276,7 @@ void FrameView::reset()
m_delayedLayout = false;
m_doFullRepaint = true;
m_layoutSchedulingEnabled = true;
- m_inLayout = false;
- m_doingPreLayoutStyleUpdate = false;
+ m_layoutPhase = OutsideLayout;
m_inSynchronousPostLayout = false;
m_layoutCount = 0;
m_nestedLayoutCount = 0;
@@ -768,7 +768,7 @@ void FrameView::updateCompositingLayersAfterStyleChange()
return;
// If we expect to update compositing after an incipient layout, don't do so here.
- if (m_doingPreLayoutStyleUpdate || layoutPending() || renderView->needsLayout())
+ if (inPreLayoutStyleUpdate() || layoutPending() || renderView->needsLayout())
return;
// This call will make sure the cached hasAcceleratedCompositing is updated from the pref
@@ -1136,9 +1136,13 @@ inline void FrameView::forceLayoutParentViewIfNeeded()
void FrameView::layout(bool allowSubtree)
{
- if (m_inLayout)
+ if (isInLayout())
return;
+ // Many of the tasks performed during layout can cause this function to be re-entered,
+ // so save the layout phase now and restore it on exit.
+ TemporaryChange<LayoutPhase> layoutPhaseRestorer(m_layoutPhase, InPreLayout);
+
// Protect the view from being deleted during layout (in recalcStyle)
RefPtr<FrameView> protector(this);
@@ -1188,11 +1192,12 @@ void FrameView::layout(bool allowSubtree)
if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !inChildFrameLayoutWithFrameFlattening) {
// This is a new top-level layout. If there are any remaining tasks from the previous
// layout, finish them now.
- m_inSynchronousPostLayout = true;
+ TemporaryChange<bool> inSynchronousPostLayoutChange(m_inSynchronousPostLayout, true);
performPostLayoutTasks();
- m_inSynchronousPostLayout = false;
}
+ m_layoutPhase = InPreLayoutStyleUpdate;
+
// Viewport-dependent media queries may cause us to need completely different style information.
if (!document->styleResolverIfExists() || document->styleResolverIfExists()->affectedByViewportChange()) {
document->styleResolverChanged(DeferRecalcStyle);
@@ -1208,8 +1213,8 @@ void FrameView::layout(bool allowSubtree)
// Always ensure our style info is up-to-date. This can happen in situations where
// the layout beats any sort of style recalc update that needs to occur.
- TemporaryChange<bool> changeDoingPreLayoutStyleUpdate(m_doingPreLayoutStyleUpdate, true);
document->updateStyleIfNeeded();
+ m_layoutPhase = InPreLayout;
subtree = m_layoutRoot;
@@ -1275,6 +1280,7 @@ void FrameView::layout(bool allowSubtree)
m_lastViewportSize = fixedLayoutSize();
else
m_lastViewportSize = visibleContentRect(IncludeScrollbars).size();
+
m_lastZoomFactor = root->style()->zoom();
// Set the initial vMode to AlwaysOn if we're auto.
@@ -1305,6 +1311,8 @@ void FrameView::layout(bool allowSubtree)
rootRenderer->setChildNeedsLayout(true);
}
}
+
+ m_layoutPhase = InPreLayout;
}
layer = root->enclosingLayer();
@@ -1320,9 +1328,14 @@ void FrameView::layout(bool allowSubtree)
}
LayoutStateDisabler layoutStateDisabler(disableLayoutState ? root->view() : 0);
- m_inLayout = true;
+ ASSERT(m_layoutPhase == InPreLayout);
+ m_layoutPhase = InLayout;
+
beginDeferredRepaints();
forceLayoutParentViewIfNeeded();
+
+ ASSERT(m_layoutPhase == InLayout);
+
root->layout();
#if ENABLE(TEXT_AUTOSIZING)
bool autosized = document->textAutosizer()->processSubtree(root);
@@ -1330,7 +1343,8 @@ void FrameView::layout(bool allowSubtree)
root->layout();
#endif
endDeferredRepaints();
- m_inLayout = false;
+
+ ASSERT(m_layoutPhase == InLayout);
if (subtree)
root->view()->popLayoutState(root);
@@ -1338,11 +1352,15 @@ void FrameView::layout(bool allowSubtree)
m_layoutRoot = 0;
} // Reset m_layoutSchedulingEnabled to its previous value.
+ m_layoutPhase = InViewSizeAdjust;
+
bool neededFullRepaint = m_doFullRepaint;
if (!subtree && !toRenderView(root)->printing())
adjustViewSize();
+ m_layoutPhase = InPostLayout;
+
m_doFullRepaint = neededFullRepaint;
// Now update the positions of all layers.
@@ -1383,10 +1401,9 @@ void FrameView::layout(bool allowSubtree)
if (RenderView* renderView = this->renderView())
renderView->updateWidgetPositions();
} else {
- m_inSynchronousPostLayout = true;
+ TemporaryChange<bool> inSynchronousPostLayoutChange(m_inSynchronousPostLayout, true);
// Calls resumeScheduledEvents()
performPostLayoutTasks();
- m_inSynchronousPostLayout = false;
}
}
@@ -2039,6 +2056,10 @@ void FrameView::scrollPositionChanged()
// FIXME: this function is misnamed; its primary purpose is to update RenderLayer positions.
void FrameView::repaintFixedElementsAfterScrolling()
{
+ // If we're scrolling as a result of updating the view size after layout, we'll update widgets and layer positions soon anyway.
+ if (m_layoutPhase == InViewSizeAdjust)
+ return;
+
// For fixed position elements, update widget positions and compositing layers after scrolling,
// but only if we're not inside of layout.
if (m_nestedLayoutCount <= 1 && hasViewportConstrainedObjects()) {
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 37d1897bd..24f0c2a27 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -105,7 +105,7 @@ public:
void scheduleRelayoutOfSubtree(RenderObject*);
void unscheduleRelayout();
bool layoutPending() const;
- bool isInLayout() const { return m_inLayout; }
+ bool isInLayout() const { return m_layoutPhase == InLayout; }
RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
void clearLayoutRoot() { m_layoutRoot = 0; }
@@ -452,6 +452,18 @@ private:
void reset();
void init();
+ enum LayoutPhase {
+ OutsideLayout,
+ InPreLayout,
+ InPreLayoutStyleUpdate,
+ InLayout,
+ InViewSizeAdjust,
+ InPostLayout,
+ };
+ LayoutPhase layoutPhase() const { return m_layoutPhase; }
+
+ bool inPreLayoutStyleUpdate() const { return m_layoutPhase == InPreLayoutStyleUpdate; }
+
virtual bool isFrameView() const OVERRIDE { return true; }
friend class RenderWidget;
@@ -567,10 +579,9 @@ private:
Timer<FrameView> m_layoutTimer;
bool m_delayedLayout;
RenderObject* m_layoutRoot;
-
+
+ LayoutPhase m_layoutPhase;
bool m_layoutSchedulingEnabled;
- bool m_inLayout;
- bool m_doingPreLayoutStyleUpdate;
bool m_inSynchronousPostLayout;
int m_layoutCount;
unsigned m_nestedLayoutCount;
diff --git a/Source/WebCore/platform/FileSystem.h b/Source/WebCore/platform/FileSystem.h
index e1d5b7e48..dc6df8ff8 100644
--- a/Source/WebCore/platform/FileSystem.h
+++ b/Source/WebCore/platform/FileSystem.h
@@ -48,7 +48,7 @@
#endif
#endif
-#if USE(CF) || (PLATFORM(QT) && defined(Q_WS_MAC))
+#if USE(CF) || (PLATFORM(QT) && defined(Q_OS_MACX))
typedef struct __CFBundle* CFBundleRef;
typedef const struct __CFData* CFDataRef;
#endif
@@ -80,7 +80,7 @@ typedef GModule* PlatformModule;
#elif PLATFORM(EFL)
typedef Eina_Module* PlatformModule;
#elif PLATFORM(QT)
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MACX)
typedef CFBundleRef PlatformModule;
#elif !defined(QT_NO_LIBRARY)
typedef QLibrary* PlatformModule;
diff --git a/Source/WebCore/platform/qt/FileSystemQt.cpp b/Source/WebCore/platform/qt/FileSystemQt.cpp
index b5d0096e7..dd130e82b 100644
--- a/Source/WebCore/platform/qt/FileSystemQt.cpp
+++ b/Source/WebCore/platform/qt/FileSystemQt.cpp
@@ -242,7 +242,7 @@ int writeToFile(PlatformFileHandle handle, const char* data, int length)
bool unloadModule(PlatformModule module)
{
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MACX)
CFRelease(module);
return true;
diff --git a/Source/WebCore/plugins/mac/PluginPackageMac.cpp b/Source/WebCore/plugins/mac/PluginPackageMac.cpp
index 6b6c41775..6c138e8c3 100644
--- a/Source/WebCore/plugins/mac/PluginPackageMac.cpp
+++ b/Source/WebCore/plugins/mac/PluginPackageMac.cpp
@@ -138,8 +138,8 @@ bool PluginPackage::fetchInfo()
if (mimeTypesFileName && CFGetTypeID(mimeTypesFileName.get()) == CFStringGetTypeID()) {
WTF::RetainPtr<CFStringRef> fileName = (CFStringRef)mimeTypesFileName.get();
- WTF::RetainPtr<CFStringRef> homeDir = adoptCF(homeDirectoryPath().createCFString());
- WTF::RetainPtr<CFStringRef> path = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR("%@/Library/Preferences/%@"), homeDir.get(), fileName.get()));
+ WTF::RetainPtr<CFStringRef> homeDir = homeDirectoryPath().createCFString();
+ WTF::RetainPtr<CFStringRef> path(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%@/Library/Preferences/%@"), homeDir.get(), fileName.get()));
WTF::RetainPtr<CFDictionaryRef> plist = readPListFile(path.get(), /*createFile*/ false, m_module);
if (plist) {
@@ -255,8 +255,8 @@ bool PluginPackage::load()
return true;
}
- WTF::RetainPtr<CFStringRef> path = adoptCF(m_path.createCFString());
- WTF::RetainPtr<CFURLRef> url = adoptCF(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path.get(),
+ WTF::RetainPtr<CFStringRef> path = m_path.createCFString();
+ WTF::RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path.get(),
kCFURLPOSIXPathStyle, false));
m_module = CFBundleCreate(NULL, url.get());
if (!m_module || !CFBundleLoadExecutable(m_module)) {
diff --git a/Source/WebCore/plugins/mac/PluginViewMac.mm b/Source/WebCore/plugins/mac/PluginViewMac.mm
index 0a7650f34..f8f2bc634 100644
--- a/Source/WebCore/plugins/mac/PluginViewMac.mm
+++ b/Source/WebCore/plugins/mac/PluginViewMac.mm
@@ -61,6 +61,9 @@
#include "WheelEvent.h"
#include "npruntime_impl.h"
#include "runtime_root.h"
+#include <AppKit/NSEvent.h>
+#include <AppKit/NSMenu.h>
+#include <AppKit/NSWindow.h>
#include <runtime/JSLock.h>
#include <runtime/JSCJSValue.h>
#include <wtf/RetainPtr.h>
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index aba037cc6..610253750 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -407,7 +407,7 @@ IntRect ChromeClientQt::windowResizerRect() const
// always draw scrollbars on the right hand side, so we assume this to be the
// location when computing the resize rect to reserve for WebKit.
QPoint resizeCornerTopLeft = QPoint(topLevelGeometry.width(), topLevelGeometry.height())
- - QPoint(scollbarThickness, scollbarThickness))
+ - QPoint(scollbarThickness, scollbarThickness)
- m_webPage->viewRectRelativeToWindow().topLeft();
QRect resizeCornerRect = QRect(resizeCornerTopLeft, QSize(scollbarThickness, scollbarThickness));