[Cherry-pick] 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)
committerGerrit Code Review <gerrit2@kim11>
Wed, 27 Mar 2013 06:15:39 +0000 (15:15 +0900)
commit840c5eb303e087079ea9783a5717b7dfd65733c5
tree916b58e7222c428232f7a4b63f23792b063307d7
parent72a9a95e8cd28a6e3358a5f1e1c98dadc7b023aa
[Cherry-pick] Use -webkit-clip-path shapes to clip HTML elements

[Title] Use -webkit-clip-path shapes to clip HTML elements
[Issues] N/A
[Problem] N/A
[Solution] Cherry picked.
[Cherry-Picker] Sanghyup Lee <sh53.lee@samsung.com>

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: http://svn.webkit.org/repository/webkit/trunk@127608 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

LayoutTests/ChangeLog
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
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/RenderTableRow.h

Change-Id: I66be251285f5966180f4b365fdb8342342d691a0
39 files changed:
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/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