Use -webkit-clip-path shapes to clip HTML elements
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2012 17:48:19 +0000 (17:48 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2012 17:48:19 +0000 (17:48 +0000)
commit8f6953d018e463c53a6109d7549bf5e08318eb00
treebcb28813ca8bcc70572f29fc5032e25f7307724a
parent2e5d50f638fd9aa66cc03301f8bf419b5f553dfe
Use -webkit-clip-path shapes to clip HTML elements
https://bugs.webkit.org/show_bug.cgi?id=95646

Reviewed by Dean Jackson.

Source/WebCore:

-webkit-clip-path creates a new layer for HTML elements now. The border,
background and content gets clipped by the clip path after any filter was
applied.

Tests: css3/masking/clip-path-circle-filter.html
       css3/masking/clip-path-circle-overflow.html
       css3/masking/clip-path-circle-overflow-hidden.html
       css3/masking/clip-path-circle-relative-overflow.html
       css3/masking/clip-path-circle.html
       css3/masking/clip-path-ellipse.html
       css3/masking/clip-path-polygon-evenodd.html
       css3/masking/clip-path-polygon-nonzero.html
       css3/masking/clip-path-polygon.html
       css3/masking/clip-path-rectangle.html

* rendering/RenderBox.h: Create new layer on clip-path.
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::requiresLayer): Create new layer on clip-path.
* rendering/RenderInline.h:
(WebCore::RenderInline::requiresLayer): Create new layer on clip-path.
* rendering/RenderLayer.cpp: Apply clip-path on context of object.
(WebCore::RenderLayer::paintLayerContents): Create new layer on clip-path.
* rendering/RenderObject.h:
(WebCore::RenderObject::hasClipPath): Indicates that renderer needs to be clipped by clip-path.
* rendering/RenderTableRow.h: Create new layer on clip-path.

LayoutTests:

Added new tests for the -webkit-clip-path property applied to HTML content.

* css3/masking/clip-path-circle-filter.html: Added.
* css3/masking/clip-path-circle-overflow.html: Added.
* css3/masking/clip-path-circle-relative-overflow.html: Added.
* css3/masking/clip-path-circle-overflow-hidden.html: Added.
* css3/masking/clip-path-circle.html: Added.
* css3/masking/clip-path-ellipse.html: Added.
* css3/masking/clip-path-polygon-evenodd.html: Added.
* css3/masking/clip-path-polygon-nonzero.html: Added.
* css3/masking/clip-path-polygon.html: Added.
* css3/masking/clip-path-rectangle.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/css3/masking/clip-path-circle-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-filter-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-filter-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-overflow-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-overflow-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-overflow-hidden-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-overflow-hidden-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.txt: Added.
* platform/mac/css3/masking/clip-path-ellipse-expected.png: Added.
* platform/mac/css3/masking/clip-path-ellipse-expected.txt: Added.
* platform/mac/css3/masking/clip-path-polygon-evenodd-expected.png: Added.
* platform/mac/css3/masking/clip-path-polygon-evenodd-expected.txt: Added.
* platform/mac/css3/masking/clip-path-polygon-expected.png: Added.
* platform/mac/css3/masking/clip-path-polygon-expected.txt: Added.
* platform/mac/css3/masking/clip-path-polygon-nonzero-expected.png: Added.
* platform/mac/css3/masking/clip-path-polygon-nonzero-expected.txt: Added.
* platform/mac/css3/masking/clip-path-rectangle-expected.png: Added.
* platform/mac/css3/masking/clip-path-rectangle-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/masking/clip-path-circle-filter.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-circle-overflow-hidden.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-circle-overflow.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-circle-relative-overflow.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-circle.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-ellipse.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-polygon-evenodd.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-polygon-nonzero.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-polygon.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-rectangle.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/css3/masking/clip-path-circle-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-filter-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-filter-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-overflow-hidden-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-overflow-hidden-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-ellipse-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-ellipse-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-evenodd-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-evenodd-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-nonzero-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-polygon-nonzero-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-rectangle-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css3/masking/clip-path-rectangle-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTableRow.h