Changeset 129215 in webkit


Ignore:
Timestamp:
Sep 21, 2012 5:08:06 AM (12 years ago)
Author:
Alexandru Chiculita
Message:

-webkit-clip-path is applied on elements that are not descendant of the container
https://bugs.webkit.org/show_bug.cgi?id=97217

Reviewed by Dirk Schulze.

Source/WebCore:

The clip-path was set on the GraphicsContext, but was never restored, thus making all the layers
rendered in the same "group" of save/restore state use the same clip-path.

Test: css3/masking/clip-path-restore.html

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::collectMatchingRulesForList):
clip-path property should create a stacking-context, otherwise the RenderLayers will not be nested,
meaning that the clip-path of the parent is not going to apply correctly.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintLayerContents):

LayoutTests:

Added a test to check that the clip-path is removed from the GraphicsContext in the second paint call.
clip-path-circle-relative-overflow had incorrect result before, so I've udpated the results on Mac
and added test expectations for the others.

  • css3/masking/clip-path-restore-expected.html: Added.
  • css3/masking/clip-path-restore.html: Added.
  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.png:
  • platform/qt/TestExpectations:
  • platform/win/Skipped:
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r129213 r129215  
     12012-09-21  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        -webkit-clip-path is applied on elements that are not descendant of the container
     4        https://bugs.webkit.org/show_bug.cgi?id=97217
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Added a test to check that the clip-path is removed from the GraphicsContext in the second paint call.
     9        clip-path-circle-relative-overflow had incorrect result before, so I've udpated the results on Mac
     10        and added test expectations for the others.
     11
     12        * css3/masking/clip-path-restore-expected.html: Added.
     13        * css3/masking/clip-path-restore.html: Added.
     14        * platform/chromium/TestExpectations:
     15        * platform/efl/TestExpectations:
     16        * platform/gtk/TestExpectations:
     17        * platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.png:
     18        * platform/qt/TestExpectations:
     19        * platform/win/Skipped:
     20
    1212012-09-21  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    222
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r129202 r129215  
    32593259webkit.org/b/91620 css3/filters/blur-filter-page-scroll-self.html [ ImageOnlyFailure Pass ]
    32603260
     3261# Needs rebaseline after bug 97217 is fixed
     3262webkit.org/b/97325 css3/masking/clip-path-circle-relative-overflow.html [ ImageOnlyFailure Pass ]
     3263
    32613264webkit.org/b/91544 media/media-continues-playing-after-replace-source.html [ Pass Timeout ]
    32623265
  • trunk/LayoutTests/platform/efl/TestExpectations

    r129213 r129215  
    5858# CSS Filters support not yet enabled (needs ENABLE_CSS_FILTERS).
    5959webkit.org/b/85465 css3/filters [ Skip ]
     60
     61# Needs rebaseline after bug 97217 is fixed
     62webkit.org/b/97325 css3/masking/clip-path-circle-relative-overflow.html [ ImageOnlyFailure Pass ]
    6063
    6164# CSS image-resolution is not yet enabled.
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r129171 r129215  
    315315# CSS Filters is disabled
    316316Bug(GTK) css3/filters [ Skip ]
     317
     318# Needs rebaseline after bug 97217 is fixed
     319webkit.org/b/97325 css3/masking/clip-path-circle-relative-overflow.html [ ImageOnlyFailure Pass ]
    317320
    318321# CSS image-set support not yet enabled (needs ENABLE_CSS_IMAGE_SET).
  • trunk/LayoutTests/platform/qt/TestExpectations

    r129171 r129215  
    1717
    1818webkit.org/b/73766 css3/unicode-bidi-isolate-aharon-failing.html [ ImageOnlyFailure ]
     19
     20# Needs rebaseline after bug 97217 is fixed
     21webkit.org/b/97325 css3/masking/clip-path-circle-relative-overflow.html [ ImageOnlyFailure Pass ]
    1922
    2023# Web Inspector: Implement support for InspectorClient::overrideDeviceMetrics() in platforms other than Chromium
  • trunk/LayoutTests/platform/win/Skipped

    r129183 r129215  
    4040# Custom filters not yet supported on Windows
    4141css3/filters/custom
     42
     43# Needs rebaseline after bug 97217 is fixed
     44# https://bugs.webkit.org/show_bug.cgi?id=97325
     45css3/masking/clip-path-circle-relative-overflow.html
    4246
    4347# CSS image-set support not yet enabled (needs ENABLE_CSS_IMAGE_SET).
  • trunk/Source/WebCore/ChangeLog

    r129208 r129215  
     12012-09-21  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        -webkit-clip-path is applied on elements that are not descendant of the container
     4        https://bugs.webkit.org/show_bug.cgi?id=97217
     5
     6        Reviewed by Dirk Schulze.
     7
     8        The clip-path was set on the GraphicsContext, but was never restored, thus making all the layers
     9        rendered in the same "group" of save/restore state use the same clip-path.
     10
     11        Test: css3/masking/clip-path-restore.html
     12
     13        * css/StyleResolver.cpp:
     14        (WebCore::StyleResolver::collectMatchingRulesForList):
     15        clip-path property should create a stacking-context, otherwise the RenderLayers will not be nested,
     16        meaning that the clip-path of the parent is not going to apply correctly.
     17
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::paintLayerContents):
     20
    1212012-09-21  Kent Tamura  <tkent@chromium.org>
    222
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r129189 r129215  
    21942194        || style->hasTransformRelatedProperty()
    21952195        || style->hasMask()
     2196        || style->clipPath()
    21962197        || style->boxReflect()
    21972198        || style->hasFilter()
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r128700 r129215  
    31153115
    31163116    // Apply clip-path to context.
     3117    bool hasClipPath = false;
    31173118    RenderStyle* style = renderer()->style();
    31183119    if (renderer()->hasClipPath() && !context->paintingDisabled() && style) {
    31193120        ASSERT(style->clipPath());
    31203121        if (style->clipPath()->getOperationType() == ClipPathOperation::SHAPE) {
     3122            hasClipPath = true;
     3123            context->save();
    31213124            ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(style->clipPath());
    3122             transparencyLayerContext->clipPath(clipPath->path(calculateLayerBounds(this, rootLayer, 0)), clipPath->windRule());
     3125            context->clipPath(clipPath->path(calculateLayerBounds(this, rootLayer, 0)), clipPath->windRule());
    31233126        }
    31243127    }
     
    32903293        m_usedTransparency = false;
    32913294    }
     3295
     3296    if (hasClipPath)
     3297        context->restore();
    32923298}
    32933299
Note: See TracChangeset for help on using the changeset viewer.