REGRESSION (r216294): The new test fails on WebKit1
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 May 2017 02:58:23 +0000 (02:58 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 May 2017 02:58:23 +0000 (02:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171780

Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
https://trac.webkit.org/216299, https://trac.webkit.org/216330

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/Scrollbar.h:
* platform/Widget.h:
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::movesPixels):
(WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
* platform/graphics/filters/FilterOperations.h:
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::paint):
* platform/ios/WidgetIOS.mm:
(WebCore::Widget::paint):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/win/WidgetWin.cpp:
(WebCore::Widget::paint):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/FilterEffectRenderer.h:
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
* rendering/RenderLayer.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
* rendering/RenderScrollbar.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):

Source/WebKit/win:

* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::paint):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
* WebProcess/Plugins/PluginView.h:

LayoutTests:

* http/tests/css/filters-on-iframes-expected.html: Removed.
* http/tests/css/filters-on-iframes.html: Removed.
* http/tests/css/resources/blank.html: Removed.
* http/tests/css/resources/references-external.html: Removed.
* http/tests/css/resources/solid-red.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216336 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/css/filters-on-iframes-expected.html [deleted file]
LayoutTests/http/tests/css/filters-on-iframes.html [deleted file]
LayoutTests/http/tests/css/resources/blank.html [deleted file]
LayoutTests/http/tests/css/resources/references-external.html [deleted file]
LayoutTests/http/tests/css/resources/solid-red.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/Scrollbar.h
Source/WebCore/platform/Widget.h
Source/WebCore/platform/graphics/filters/FilterOperation.h
Source/WebCore/platform/graphics/filters/FilterOperations.cpp
Source/WebCore/platform/graphics/filters/FilterOperations.h
Source/WebCore/platform/gtk/WidgetGtk.cpp
Source/WebCore/platform/ios/WidgetIOS.mm
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/platform/win/WidgetWin.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/FilterEffectRenderer.h
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderScrollbar.cpp
Source/WebCore/rendering/RenderScrollbar.h
Source/WebCore/rendering/RenderWidget.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginView.h
Source/WebKit/win/Plugins/PluginViewWin.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h

index 2c30d38..a2e4fcb 100644 (file)
@@ -1,3 +1,17 @@
+2017-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r216294): The new test fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=171780
+
+        Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
+        https://trac.webkit.org/216299, https://trac.webkit.org/216330
+
+        * http/tests/css/filters-on-iframes-expected.html: Removed.
+        * http/tests/css/filters-on-iframes.html: Removed.
+        * http/tests/css/resources/blank.html: Removed.
+        * http/tests/css/resources/references-external.html: Removed.
+        * http/tests/css/resources/solid-red.html: Removed.
+
 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
 
         [iOS WK2] Make rotation tests more reliable
diff --git a/LayoutTests/http/tests/css/filters-on-iframes-expected.html b/LayoutTests/http/tests/css/filters-on-iframes-expected.html
deleted file mode 100644 (file)
index 7d12325..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<style>
-body {
-    margin: 0;
-    padding: 0;
-}
-iframe {
-    border: none;
-}
-div {
-    display: inline-block;
-}
-</style>
-
-<div>
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<br>
-
-<div>
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="resources/blank.html"></iframe>
-</div>
-
-<br>
-
-<div>
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="resources/blank.html"></iframe>
-</div>
diff --git a/LayoutTests/http/tests/css/filters-on-iframes.html b/LayoutTests/http/tests/css/filters-on-iframes.html
deleted file mode 100644 (file)
index 2af62b2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<style>
-body {
-    margin: 0;
-    padding: 0;
-}
-iframe {
-    border: none;
-}
-div {
-    display: inline-block;
-}
-.filtered {
-    filter: url(#noop);
-}
-svg {
-    display: none;
-}
-</style>
-
-<div>
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="resources/solid-red.html"></iframe>
-</div>
-
-<br>
-
-<div>
-    <iframe src="http://localhost:8000/css/resources/solid-red.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="http://localhost:8000/css/resources/solid-red.html"></iframe>
-</div>
-
-<br>
-
-<div>
-    <iframe src="resources/references-external.html"></iframe>
-</div>
-
-<div class="filtered">
-    <iframe src="resources/references-external.html"></iframe>
-</div>
-
-<svg>
-    <defs>
-        <filter id="noop">
-            <feMorphology operator="dilate" in="SourceGraphic" radius="0"/>
-        </filter>
-    </defs>
-</svg>
diff --git a/LayoutTests/http/tests/css/resources/blank.html b/LayoutTests/http/tests/css/resources/blank.html
deleted file mode 100644 (file)
index 1b315cb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<style>
-    body {
-        background-color: white;
-    }
-</style>
diff --git a/LayoutTests/http/tests/css/resources/references-external.html b/LayoutTests/http/tests/css/resources/references-external.html
deleted file mode 100644 (file)
index dd6ec12..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<style>
-body {
-    margin: 0;
-    padding: 0;
-}
-
-iframe {
-    border: none;
-}
-</style>
-<iframe src="http://localhost:8000/css/resources/solid-red.html"></iframe>
diff --git a/LayoutTests/http/tests/css/resources/solid-red.html b/LayoutTests/http/tests/css/resources/solid-red.html
deleted file mode 100644 (file)
index 8ee73d7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<style>
-    body {
-        background-color: red;
-    }
-</style>
index d9eea43..3c57cda 100644 (file)
@@ -1,3 +1,52 @@
+2017-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r216294): The new test fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=171780
+
+        Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
+        https://trac.webkit.org/216299, https://trac.webkit.org/216330
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::paint):
+        * platform/ScrollView.h:
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::paint):
+        * platform/Scrollbar.h:
+        * platform/Widget.h:
+        * platform/graphics/filters/FilterOperation.h:
+        (WebCore::FilterOperation::movesPixels):
+        (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
+        * platform/graphics/filters/FilterOperations.cpp:
+        (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
+        * platform/graphics/filters/FilterOperations.h:
+        * platform/gtk/WidgetGtk.cpp:
+        (WebCore::Widget::paint):
+        * platform/ios/WidgetIOS.mm:
+        (WebCore::Widget::paint):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::paint):
+        * platform/win/WidgetWin.cpp:
+        (WebCore::Widget::paint):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::build):
+        * rendering/FilterEffectRenderer.h:
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::PaintInfo):
+        (): Deleted.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paint):
+        (WebCore::RenderLayer::setupFilters):
+        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
+        * rendering/RenderLayer.h:
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::paint):
+        * rendering/RenderScrollbar.h:
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paintContents):
+
 2017-05-06  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r216333.
index 8122d77..6719e90 100644 (file)
@@ -4419,7 +4419,7 @@ void FrameView::didPaintContents(GraphicsContext& context, const IntRect& dirtyR
     }
 }
 
-void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect, SecurityOriginPaintPolicy securityOriginPaintPolicy)
+void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect)
 {
 #ifndef NDEBUG
     bool fillWithRed;
@@ -4471,7 +4471,7 @@ void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect
     while (is<RenderInline>(renderer) && !downcast<RenderInline>(*renderer).firstLineBox())
         renderer = renderer->parent();
 
-    rootLayer->paint(context, dirtyRect, LayoutSize(), m_paintBehavior, renderer, 0, securityOriginPaintPolicy == SecurityOriginPaintPolicy::AnyOrigin ? RenderLayer::SecurityOriginPaintPolicy::AnyOrigin : RenderLayer::SecurityOriginPaintPolicy::AccessibleOriginOnly);
+    rootLayer->paint(context, dirtyRect, LayoutSize(), m_paintBehavior, renderer);
     if (rootLayer->containsDirtyOverlayScrollbars())
         rootLayer->paintOverlayScrollbars(context, dirtyRect, m_paintBehavior, renderer);
 
index cdb2fbe..b14fef3 100644 (file)
@@ -344,7 +344,7 @@ public:
     void addEmbeddedObjectToUpdate(RenderEmbeddedObject&);
     void removeEmbeddedObjectToUpdate(RenderEmbeddedObject&);
 
-    WEBCORE_EXPORT void paintContents(GraphicsContext&, const IntRect& dirtyRect, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) final;
+    WEBCORE_EXPORT void paintContents(GraphicsContext&, const IntRect& dirtyRect) final;
 
     struct PaintingState {
         PaintBehavior paintBehavior;
index b198a7c..a425f6b 100644 (file)
@@ -1166,7 +1166,7 @@ void ScrollView::paintPanScrollIcon(GraphicsContext& context)
     context.drawImage(*panScrollIcon, iconGCPoint);
 }
 
-void ScrollView::paint(GraphicsContext& context, const IntRect& rect, SecurityOriginPaintPolicy securityOriginPaintPolicy)
+void ScrollView::paint(GraphicsContext& context, const IntRect& rect)
 {
     if (platformWidget()) {
         Widget::paint(context, rect);
@@ -1198,7 +1198,7 @@ void ScrollView::paint(GraphicsContext& context, const IntRect& rect, SecurityOr
             context.clip(visibleContentRect(LegacyIOSDocumentVisibleRect));
         }
 
-        paintContents(context, documentDirtyRect, securityOriginPaintPolicy);
+        paintContents(context, documentDirtyRect);
     }
 
 #if ENABLE(RUBBER_BANDING)
index 9622188..2d3aef7 100644 (file)
@@ -344,7 +344,7 @@ public:
     }
 
     // Widget override. Handles painting of the contents of the view as well as the scrollbars.
-    WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) final;
+    WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&) final;
     void paintScrollbars(GraphicsContext&, const IntRect&);
 
     // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
@@ -380,7 +380,7 @@ protected:
     ScrollView();
 
     virtual void repaintContentRectangle(const IntRect&);
-    virtual void paintContents(GraphicsContext&, const IntRect& damageRect, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) = 0;
+    virtual void paintContents(GraphicsContext&, const IntRect& damageRect) = 0;
 
     virtual void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
 
index 050d4d9..5d0a8ef 100644 (file)
@@ -157,7 +157,7 @@ void Scrollbar::updateThumbProportion()
     updateThumb();
 }
 
-void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
+void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect)
 {
     if (context.updatingControlTints() && theme().supportsControlTints()) {
         invalidate();
index a3d7d9f..a236c7e 100644 (file)
@@ -85,7 +85,7 @@ public:
     WEBCORE_EXPORT void setProportion(int visibleSize, int totalSize);
     void setPressedPos(int p) { m_pressedPos = p; }
 
-    void paint(GraphicsContext&, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) override;
+    void paint(GraphicsContext&, const IntRect& damageRect) override;
 
     bool enabled() const { return m_enabled; }
     virtual void setEnabled(bool);
index 47dce78..55b49a4 100644 (file)
@@ -114,9 +114,7 @@ public:
     void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); }
     void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); }
 
-    enum class SecurityOriginPaintPolicy { AnyOrigin, AccessibleOriginOnly };
-
-    WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin);
+    WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&);
     void invalidate() { invalidateRect(boundsRect()); }
     virtual void invalidateRect(const IntRect&) = 0;
 
index 4caeb49..633696f 100644 (file)
@@ -103,8 +103,6 @@ public:
     virtual bool affectsOpacity() const { return false; }
     // True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
     virtual bool movesPixels() const { return false; }
-    // True if the filter should not be allowed to work on content that is not available from this security origin.
-    virtual bool shouldBeRestrictedBySecurityOrigin() const { return false; }
     // True if the filter needs the size of the box in order to calculate the animations.
     virtual bool blendingNeedsRendererSize() const { return false; }
 
@@ -184,9 +182,6 @@ public:
 
     bool affectsOpacity() const override { return true; }
     bool movesPixels() const override { return true; }
-    // FIXME: This only needs to return true for graphs that include ConvolveMatrix, DisplacementMap, Morphology and possibly Lighting.
-    // https://bugs.webkit.org/show_bug.cgi?id=171753
-    bool shouldBeRestrictedBySecurityOrigin() const override { return true; }
 
     const String& url() const { return m_url; }
     const String& fragment() const { return m_fragment; }
index a1824f9..dc2be1b 100644 (file)
@@ -137,15 +137,6 @@ bool FilterOperations::hasFilterThatMovesPixels() const
     return false;
 }
 
-bool FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin() const
-{
-    for (auto& operation : m_operations) {
-        if (operation->shouldBeRestrictedBySecurityOrigin())
-            return true;
-    }
-    return false;
-}
-
 TextStream& operator<<(TextStream& ts, const FilterOperations& filters)
 {
     for (size_t i = 0; i < filters.size(); ++i) {
index 0752e8d..486f686 100644 (file)
@@ -56,7 +56,6 @@ public:
 
     bool hasFilterThatAffectsOpacity() const;
     bool hasFilterThatMovesPixels() const;
-    bool hasFilterThatShouldBeRestrictedBySecurityOrigin() const;
 
     bool hasReferenceFilter() const;
 
index 8741293..2ee3182 100644 (file)
@@ -80,7 +80,7 @@ void Widget::hide()
         gtk_widget_hide(platformWidget());
 }
 
-void Widget::paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy)
+void Widget::paint(GraphicsContext&, const IntRect&)
 {
 }
 
index d8e10d1..c0e9d88 100644 (file)
@@ -139,7 +139,7 @@ NSView* Widget::getOuterView() const
     return view;
 }
 
-void Widget::paint(GraphicsContext& p, const IntRect& r, SecurityOriginPaintPolicy)
+void Widget::paint(GraphicsContext& p, const IntRect& r)
 {
     if (p.paintingDisabled())
         return;
index 60f1bbc..ed30ab0 100644 (file)
@@ -184,7 +184,7 @@ NSView *Widget::getOuterView() const
     return view;
 }
 
-void Widget::paint(GraphicsContext& p, const IntRect& r, SecurityOriginPaintPolicy)
+void Widget::paint(GraphicsContext& p, const IntRect& r)
 {
     if (p.paintingDisabled())
         return;
index 8bdc023..64dfa90 100644 (file)
@@ -75,7 +75,7 @@ void Widget::setCursor(const Cursor& cursor)
     view->hostWindow()->setCursor(cursor);
 }
 
-void Widget::paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy)
+void Widget::paint(GraphicsContext&, const IntRect&)
 {
 }
 
index 4254ef9..f59f15f 100644 (file)
@@ -128,7 +128,6 @@ RefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement& r
 bool FilterEffectRenderer::build(RenderElement& renderer, const FilterOperations& operations, FilterConsumer consumer)
 {
     m_hasFilterThatMovesPixels = operations.hasFilterThatMovesPixels();
-    m_hasFilterThatShouldBeRestrictedBySecurityOrigin = operations.hasFilterThatShouldBeRestrictedBySecurityOrigin();
     if (m_hasFilterThatMovesPixels)
         m_outsets = operations.outsets();
 
index f8eab8f..bc2386a 100644 (file)
@@ -84,7 +84,6 @@ public:
     void apply();
 
     bool hasFilterThatMovesPixels() const { return m_hasFilterThatMovesPixels; }
-    bool hasFilterThatShouldBeRestrictedBySecurityOrigin() const { return m_hasFilterThatShouldBeRestrictedBySecurityOrigin; }
 
 private:
     FilterEffectRenderer();
@@ -116,7 +115,6 @@ private:
 
     bool m_graphicsBufferAttached { false };
     bool m_hasFilterThatMovesPixels { false };
-    bool m_hasFilterThatShouldBeRestrictedBySecurityOrigin { false };
 };
 
 inline FilterEffectRendererHelper::FilterEffectRendererHelper(bool haveFilterEffect, GraphicsContext& targetContext)
index 5a6748e..84d46b6 100644 (file)
@@ -50,8 +50,7 @@ typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap;
 struct PaintInfo {
     PaintInfo(GraphicsContext& newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior,
         RenderObject* newSubtreePaintRoot = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr,
-        OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr,
-        bool newRequireSecurityOriginAccessForWidgets = false)
+        OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr)
             : rect(newRect)
             , phase(newPhase)
             , paintBehavior(newPaintBehavior)
@@ -59,7 +58,6 @@ struct PaintInfo {
             , outlineObjects(newOutlineObjects)
             , overlapTestRequests(overlapTestRequests)
             , paintContainer(newPaintContainer)
-            , requireSecurityOriginAccessForWidgets(newRequireSecurityOriginAccessForWidgets)
             , m_context(&newContext)
     {
     }
@@ -122,7 +120,6 @@ struct PaintInfo {
     ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children
     OverlapTestRequestMap* overlapTestRequests;
     const RenderLayerModelObject* paintContainer; // the layer object that originates the current painting
-    bool requireSecurityOriginAccessForWidgets { false };
 
 private:
     GraphicsContext* m_context;
index 0238252..bb3d2b7 100644 (file)
@@ -3843,11 +3843,11 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit
     return ScrollableArea::scroll(direction, granularity, multiplier);
 }
 
-void RenderLayer::paint(GraphicsContext& context, const LayoutRect& damageRect, const LayoutSize& subpixelOffset, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, PaintLayerFlags paintFlags, SecurityOriginPaintPolicy paintPolicy)
+void RenderLayer::paint(GraphicsContext& context, const LayoutRect& damageRect, const LayoutSize& subpixelOffset, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, PaintLayerFlags paintFlags)
 {
     OverlapTestRequestMap overlapTestRequests;
 
-    LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, subpixelOffset, subtreePaintRoot, &overlapTestRequests, paintPolicy == SecurityOriginPaintPolicy::AccessibleOriginOnly);
+    LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, subpixelOffset, subtreePaintRoot, &overlapTestRequests);
     paintLayer(context, paintingInfo, paintFlags);
 
     for (auto& widget : overlapTestRequests.keys())
@@ -4242,8 +4242,6 @@ std::unique_ptr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsCo
     // Note that we will still apply the clipping on the final rendering of the filter.
     paintingInfo.clipToDirtyRect = !filterInfo.renderer()->hasFilterThatMovesPixels();
 
-    paintingInfo.requireSecurityOriginAccessForWidgets = filterInfo.renderer()->hasFilterThatShouldBeRestrictedBySecurityOrigin();
-
     return WTFMove(painter.second);
 }
 
@@ -4811,7 +4809,7 @@ void RenderLayer::paintForegroundForFragmentsWithPhase(PaintPhase phase, const L
         if (shouldClip)
             clipToRect(context, localPaintingInfo, fragment.foregroundRect);
     
-        PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), localPaintingInfo.requireSecurityOriginAccessForWidgets);
+        PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer());
         if (phase == PaintPhaseForeground)
             paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests;
         renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset));
index b9e5e3e..6e17507 100644 (file)
@@ -496,14 +496,12 @@ public:
     
     typedef unsigned PaintLayerFlags;
 
-    enum class SecurityOriginPaintPolicy { AnyOrigin, AccessibleOriginOnly };
-
     // The two main functions that use the layer system.  The paint method
     // paints the layers that intersect the damage rect from back to
     // front.  The hitTest method looks for mouse events by walking
     // layers that intersect the point from front to back.
     void paint(GraphicsContext&, const LayoutRect& damageRect, const LayoutSize& subpixelOffset = LayoutSize(), PaintBehavior = PaintBehaviorNormal,
-        RenderObject* subtreePaintRoot = nullptr, PaintLayerFlags = 0, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin);
+        RenderObject* subtreePaintRoot = nullptr, PaintLayerFlags = 0);
     bool hitTest(const HitTestRequest&, HitTestResult&);
     bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
     void paintOverlayScrollbars(GraphicsContext&, const LayoutRect& damageRect, PaintBehavior, RenderObject* subtreePaintRoot = nullptr);
@@ -720,14 +718,14 @@ private:
     enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainers };
 
     struct LayerPaintingInfo {
-        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSupixelOffset, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr, bool inRequireSecurityOriginAccessForWidgets = false)
+        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSupixelOffset, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr)
             : rootLayer(inRootLayer)
             , subtreePaintRoot(inSubtreePaintRoot)
             , paintDirtyRect(inDirtyRect)
             , subpixelOffset(inSupixelOffset)
             , overlapTestRequests(inOverlapTestRequests)
             , paintBehavior(inPaintBehavior)
-            , requireSecurityOriginAccessForWidgets(inRequireSecurityOriginAccessForWidgets)
+            , clipToDirtyRect(true)
         { }
         RenderLayer* rootLayer;
         RenderObject* subtreePaintRoot; // only paint descendants of this object
@@ -735,8 +733,7 @@ private:
         LayoutSize subpixelOffset;
         OverlapTestRequestMap* overlapTestRequests; // May be null.
         PaintBehavior paintBehavior;
-        bool requireSecurityOriginAccessForWidgets;
-        bool clipToDirtyRect { true };
+        bool clipToDirtyRect;
     };
 
     // Compute, cache and return clip rects computed with the given layer as the root.
index 56bf759..c52a4ce 100644 (file)
@@ -102,7 +102,7 @@ void RenderScrollbar::styleChanged()
     updateScrollbarParts();
 }
 
-void RenderScrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
+void RenderScrollbar::paint(GraphicsContext& context, const IntRect& damageRect)
 {
     if (context.updatingControlTints()) {
         updateScrollbarParts();
index 176fcca..bdb81da 100644 (file)
@@ -66,7 +66,7 @@ private:
     void setParent(ScrollView*) override;
     void setEnabled(bool) override;
 
-    void paint(GraphicsContext&, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy) override;
+    void paint(GraphicsContext&, const IntRect& damageRect) override;
 
     void setHoveredPart(ScrollbarPart) override;
     void setPressedPart(ScrollbarPart) override;
index b5b1888..623a6c7 100644 (file)
@@ -31,7 +31,6 @@
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
 #include "RenderView.h"
-#include "SecurityOrigin.h"
 #include <wtf/StackStats.h>
 #include <wtf/Ref.h>
 
@@ -217,13 +216,6 @@ void RenderWidget::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
 
 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
-    if (paintInfo.requireSecurityOriginAccessForWidgets) {
-        if (auto contentDocument = frameOwnerElement().contentDocument()) {
-            if (!document().securityOrigin().canAccess(contentDocument->securityOrigin()))
-                return;
-        }
-    }
-
     IntPoint contentPaintOffset = roundedIntPoint(paintOffset + location() + contentBoxRect().location());
     // Tell the widget to paint now. This is the only time the widget is allowed
     // to paint itself. That way it will composite properly with z-indexed layers.
@@ -237,8 +229,8 @@ void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
         paintInfo.context().translate(widgetPaintOffset);
         paintRect.move(-widgetPaintOffset);
     }
-    // FIXME: Remove repaintrect enclosing/integral snapping when RenderWidget becomes device pixel snapped.
-    m_widget->paint(paintInfo.context(), snappedIntRect(paintRect), paintInfo.requireSecurityOriginAccessForWidgets ? Widget::SecurityOriginPaintPolicy::AccessibleOriginOnly : Widget::SecurityOriginPaintPolicy::AnyOrigin);
+    // FIXME: Remove repaintrect encolsing/integral snapping when RenderWidget becomes device pixel snapped.
+    m_widget->paint(paintInfo.context(), snappedIntRect(paintRect));
 
     if (!widgetPaintOffset.isZero())
         paintInfo.context().translate(-widgetPaintOffset);
index c941f1f..6bff14f 100644 (file)
@@ -1,3 +1,15 @@
+2017-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r216294): The new test fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=171780
+
+        Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
+        https://trac.webkit.org/216299, https://trac.webkit.org/216330
+
+        * Plugins/PluginView.h:
+        * Plugins/PluginViewWin.cpp:
+        (WebCore::PluginView::paint):
+
 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
 
         Fix Windows build after r216294.
index 214bdfc..969ba7c 100644 (file)
@@ -180,7 +180,7 @@ namespace WebCore {
         void setFocus(bool) override;
         void show() override;
         void hide() override;
-        void paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy) override;
+        void paint(GraphicsContext&, const IntRect&) override;
         void clipRectChanged() override;
 
         // This method is used by plugins on all platforms to obtain a clip rect that includes clips set by WebCore,
index 7573fab..24fb13e 100644 (file)
@@ -537,7 +537,7 @@ void PluginView::paintWindowedPluginIntoContext(GraphicsContext& context, const
 #endif
 }
 
-void PluginView::paint(GraphicsContext& context, const IntRect& rect, SecurityOriginPaintPolicy)
+void PluginView::paint(GraphicsContext& context, const IntRect& rect)
 {
     if (!m_isStarted) {
         // Draw the "missing plugin" image
index 7fca70e..d257c97 100644 (file)
@@ -1,3 +1,15 @@
+2017-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r216294): The new test fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=171780
+
+        Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
+        https://trac.webkit.org/216299, https://trac.webkit.org/216330
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::paint):
+        * WebProcess/Plugins/PluginView.h:
+
 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
 
         [iOS WK2] Make rotation tests more reliable
index 45bdc19..8c04351 100644 (file)
@@ -782,7 +782,7 @@ void PluginView::setFrameRect(const WebCore::IntRect& rect)
     viewGeometryDidChange();
 }
 
-void PluginView::paint(GraphicsContext& context, const IntRect& /*dirtyRect*/, Widget::SecurityOriginPaintPolicy)
+void PluginView::paint(GraphicsContext& context, const IntRect& /*dirtyRect*/)
 {
     if (!m_plugin || !m_isInitialized || m_pluginElement->displayState() < HTMLPlugInElement::Restarting)
         return;
index d34748d..f7bcddc 100644 (file)
@@ -171,7 +171,7 @@ private:
 
     // WebCore::Widget
     void setFrameRect(const WebCore::IntRect&) override;
-    void paint(WebCore::GraphicsContext&, const WebCore::IntRect&, WebCore::Widget::SecurityOriginPaintPolicy) override;
+    void paint(WebCore::GraphicsContext&, const WebCore::IntRect&) override;
     void invalidateRect(const WebCore::IntRect&) override;
     void setFocus(bool) override;
     void frameRectsChanged() override;