Diff
Modified: trunk/Source/WebCore/ChangeLog (148563 => 148564)
--- trunk/Source/WebCore/ChangeLog 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/ChangeLog 2013-04-16 23:01:02 UTC (rev 148564)
@@ -1,3 +1,36 @@
+2013-04-16 Beth Dakin <[email protected]>
+
+ Need a new layout milestone to notify bundle clients when the header has been
+ flushed
+ https://bugs.webkit.org/show_bug.cgi?id=114706
+ -and corresponding-
+ <rdar://problem/13657284>
+
+ Reviewed by Simon Fraser.
+
+ New LayoutMilestone is DidFirstFlushForHeaderLayer.
+ * page/LayoutMilestones.h:
+
+ New API to allow removing a LayoutMilestone.
+ * WebCore.exp.in:
+ * page/Page.cpp:
+ (WebCore::Page::removeLayoutMilestones):
+ * page/Page.h:
+ (Page):
+
+ New boolean member variable m_headerLayerAwaitingFirstFlush keeps track of whether
+ we need to send the DidFirstFlushForHeaderLayer milestone.
+ * rendering/RenderLayerCompositor.h:
+ (RenderLayerCompositor):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+
+ Send the milestone if appropriate.
+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+
+ Set m_headerLayerAwaitingFirstFlush to true for a newly created layer.
+ (WebCore::RenderLayerCompositor::updateLayerForHeader):
+
2013-04-16 Tim Horton <[email protected]>
PlugIn Snapshotting: Crashes refreshing non-main-frame PDFPlugins
Modified: trunk/Source/WebCore/WebCore.exp.in (148563 => 148564)
--- trunk/Source/WebCore/WebCore.exp.in 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-04-16 23:01:02 UTC (rev 148564)
@@ -835,6 +835,7 @@
__ZN7WebCore4Page21markAllMatchesForTextERKN3WTF6StringEjbj
__ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE
__ZN7WebCore4Page22nonFastScrollableRectsEPKNS_5FrameE
+__ZN7WebCore4Page22removeLayoutMilestonesEj
__ZN7WebCore4Page22setRubberBandsAtBottomEb
__ZN7WebCore4Page23clearUndoRedoOperationsEv
__ZN7WebCore4Page24findStringMatchingRangesERKN3WTF6StringEjiPNS1_6VectorINS1_6RefPtrINS_5RangeEEELm0ENS1_15CrashOnOverflowEEERi
Modified: trunk/Source/WebCore/page/LayoutMilestones.h (148563 => 148564)
--- trunk/Source/WebCore/page/LayoutMilestones.h 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/page/LayoutMilestones.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -31,7 +31,8 @@
enum LayoutMilestoneFlag {
DidFirstLayout = 1 << 0,
DidFirstVisuallyNonEmptyLayout = 1 << 1,
- DidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2
+ DidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2,
+ DidFirstFlushForHeaderLayer = 1 << 3
};
typedef unsigned LayoutMilestones;
Modified: trunk/Source/WebCore/page/Page.cpp (148563 => 148564)
--- trunk/Source/WebCore/page/Page.cpp 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/page/Page.cpp 2013-04-16 23:01:02 UTC (rev 148564)
@@ -1274,6 +1274,11 @@
m_layoutMilestones |= milestones;
}
+void Page::removeLayoutMilestones(LayoutMilestones milestones)
+{
+ m_layoutMilestones &= ~milestones;
+}
+
// These are magical constants that might be tweaked over time.
static double gMinimumPaintedAreaRatio = 0.1;
static double gMaximumUnpaintedAreaRatio = 0.04;
Modified: trunk/Source/WebCore/page/Page.h (148563 => 148564)
--- trunk/Source/WebCore/page/Page.h 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/page/Page.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -352,6 +352,7 @@
PlatformDisplayID displayID() const { return m_displayID; }
void addLayoutMilestones(LayoutMilestones);
+ void removeLayoutMilestones(LayoutMilestones);
LayoutMilestones layoutMilestones() const { return m_layoutMilestones; }
bool isCountingRelevantRepaintedObjects() const;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (148563 => 148564)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-04-16 23:01:02 UTC (rev 148564)
@@ -217,6 +217,7 @@
, m_layerFlushThrottlingEnabled(false)
, m_layerFlushThrottlingTemporarilyDisabledForInteraction(false)
, m_hasPendingLayerFlush(false)
+ , m_headerLayerAwaitingFirstFlush(false)
#if !LOG_DISABLED
, m_rootLayerUpdateCount(0)
, m_obligateCompositedLayerCount(0)
@@ -375,6 +376,16 @@
ASSERT(m_flushingLayers);
m_flushingLayers = false;
+ if (m_headerLayerAwaitingFirstFlush) {
+ m_headerLayerAwaitingFirstFlush = false;
+ if (Page* page = this->page()) {
+ if (page->layoutMilestones() & DidFirstFlushForHeaderLayer) {
+ if (Frame* frame = page->mainFrame())
+ frame->loader()->didLayout(DidFirstFlushForHeaderLayer);
+ }
+ }
+ }
+
if (!m_viewportConstrainedLayersNeedingUpdate.isEmpty()) {
HashSet<RenderLayer*>::const_iterator end = m_viewportConstrainedLayersNeedingUpdate.end();
for (HashSet<RenderLayer*>::const_iterator it = m_viewportConstrainedLayersNeedingUpdate.begin(); it != end; ++it)
@@ -2514,6 +2525,7 @@
m_layerForHeader->setName("header");
#endif
m_scrollLayer->addChildBelow(m_layerForHeader.get(), m_rootContentLayer.get());
+ m_headerLayerAwaitingFirstFlush = true;
}
m_layerForHeader->setPosition(FloatPoint(0, 0));
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (148563 => 148564)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -453,6 +453,7 @@
bool m_layerFlushThrottlingEnabled;
bool m_layerFlushThrottlingTemporarilyDisabledForInteraction;
bool m_hasPendingLayerFlush;
+ bool m_headerLayerAwaitingFirstFlush;
#if !LOG_DISABLED
int m_rootLayerUpdateCount;
Modified: trunk/Source/WebKit2/ChangeLog (148563 => 148564)
--- trunk/Source/WebKit2/ChangeLog 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebKit2/ChangeLog 2013-04-16 23:01:02 UTC (rev 148564)
@@ -1,3 +1,30 @@
+2013-04-16 Beth Dakin <[email protected]>
+
+ Need a new layout milestone to notify bundle clients when the header has been
+ flushed
+ https://bugs.webkit.org/show_bug.cgi?id=114706
+ -and corresponding-
+ <rdar://problem/13657284>
+
+ Reviewed by Simon Fraser.
+
+ Make this new LayoutMilestone private at the API layer.
+ * Shared/API/c/WKPageLoadTypes.h:
+ * Shared/API/c/WKPageLoadTypesPrivate.h: Added.
+
+ Handle the new milestone.
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toWKLayoutMilestones):
+ (WebKit::toLayoutMilestones):
+
+ New file to make the milestone private.
+ * WebKit2.xcodeproj/project.pbxproj:
+
+ Add or remove the DidFirstFlushForHeaderLayer millstone based on whether we just
+ added or removed a header.
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::setHeaderLayerWithHeight):
+
2013-04-16 Ryosuke Niwa <[email protected]>
Another EFL build fix.
Modified: trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypes.h (148563 => 148564)
--- trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypes.h 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypes.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -51,7 +51,8 @@
enum {
kWKDidFirstLayout = 1 << 0,
kWKDidFirstVisuallyNonEmptyLayout = 1 << 1,
- kWKDidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2
+ kWKDidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2,
+ kWKReserved = 1 << 3 // Note that the fourth member of this enum is actually private and defined in WKPageLoadTypesPrivate.h
};
typedef uint32_t WKLayoutMilestones;
Added: trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypesPrivate.h (0 => 148564)
--- trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypesPrivate.h (rev 0)
+++ trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypesPrivate.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKPageLoadTypesPrivate_h
+#define WKPageLoadTypesPrivate_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// This is an extension of the WKLayoutMilestones enum defined in WKPageLoadTypes.h
+enum {
+ kWKDidFirstFlushForHeaderLayer = 1 << 3
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKPageLoadTypesPrivate_h */
Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (148563 => 148564)
--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h 2013-04-16 23:01:02 UTC (rev 148564)
@@ -35,6 +35,7 @@
#include "WKGeometry.h"
#include "WKImage.h"
#include "WKPageLoadTypes.h"
+#include "WKPageLoadTypesPrivate.h"
#include "WKPageVisibilityTypes.h"
#include "WebError.h"
#include "WebEvent.h"
@@ -799,6 +800,8 @@
wkMilestones |= kWKDidFirstVisuallyNonEmptyLayout;
if (milestones & WebCore::DidHitRelevantRepaintedObjectsAreaThreshold)
wkMilestones |= kWKDidHitRelevantRepaintedObjectsAreaThreshold;
+ if (milestones & WebCore::DidFirstFlushForHeaderLayer)
+ wkMilestones |= kWKDidFirstFlushForHeaderLayer;
return wkMilestones;
}
@@ -813,6 +816,8 @@
milestones |= WebCore::DidFirstVisuallyNonEmptyLayout;
if (wkMilestones & kWKDidHitRelevantRepaintedObjectsAreaThreshold)
milestones |= WebCore::DidHitRelevantRepaintedObjectsAreaThreshold;
+ if (wkMilestones & kWKDidFirstFlushForHeaderLayer)
+ milestones |= WebCore::DidFirstFlushForHeaderLayer;
return milestones;
}
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (148563 => 148564)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-04-16 23:01:02 UTC (rev 148564)
@@ -587,6 +587,7 @@
9394AE441702B25B00344232 /* WKBundlePagePrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9394AE421702B25B00344232 /* WKBundlePagePrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
9394AE451702B25B00344232 /* WKBundlePagePrivateMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9394AE431702B25B00344232 /* WKBundlePagePrivateMac.mm */; };
939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */; };
+ 93BDEB01171DD7AF00BFEE1B /* WKPageLoadTypesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 93BDEB00171DD7AF00BFEE1B /* WKPageLoadTypesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */; };
93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC679E12D3CC7400A60610 /* DecoderAdapter.h */; };
93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */; };
@@ -2012,6 +2013,7 @@
9394AE421702B25B00344232 /* WKBundlePagePrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePagePrivateMac.h; sourceTree = "<group>"; };
9394AE431702B25B00344232 /* WKBundlePagePrivateMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBundlePagePrivateMac.mm; sourceTree = "<group>"; };
939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreArgumentCoders.cpp; sourceTree = "<group>"; };
+ 93BDEB00171DD7AF00BFEE1B /* WKPageLoadTypesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageLoadTypesPrivate.h; sourceTree = "<group>"; };
93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DecoderAdapter.cpp; sourceTree = "<group>"; };
93FC679E12D3CC7400A60610 /* DecoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecoderAdapter.h; sourceTree = "<group>"; };
93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncoderAdapter.cpp; sourceTree = "<group>"; };
@@ -4829,6 +4831,7 @@
BC4075E5124FF0270068F20A /* WKNumber.cpp */,
BC4075E6124FF0270068F20A /* WKNumber.h */,
BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */,
+ 93BDEB00171DD7AF00BFEE1B /* WKPageLoadTypesPrivate.h */,
A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */,
37948406150C4B9600E52CE9 /* WKRenderLayer.cpp */,
37948407150C4B9600E52CE9 /* WKRenderLayer.h */,
@@ -5219,6 +5222,7 @@
BCA8C6A911E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h in Headers */,
BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */,
BCA8C6B011E3C08700812FB7 /* InjectedBundlePageUIClient.h in Headers */,
+ 93BDEB01171DD7AF00BFEE1B /* WKPageLoadTypesPrivate.h in Headers */,
BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (148563 => 148564)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2013-04-16 23:01:00 UTC (rev 148563)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2013-04-16 23:01:02 UTC (rev 148564)
@@ -837,9 +837,13 @@
m_headerLayer = layer;
GraphicsLayer* parentLayer = frameView->setWantsLayerForHeader(m_headerLayer);
- if (!parentLayer)
+ if (!parentLayer) {
+ m_page->removeLayoutMilestones(DidFirstFlushForHeaderLayer);
return;
+ }
+ m_page->addLayoutMilestones(DidFirstFlushForHeaderLayer);
+
m_headerLayer.get().bounds = CGRectMake(0, 0, parentLayer->size().width(), parentLayer->size().height());
[parentLayer->platformLayer() addSublayer:m_headerLayer.get()];
}