[CSS Shapes] Can't select content within the area of the floating box when clip-path is applied (issue 240423005)

0 views
Skip to first unread message

dsch...@chromium.org

unread,
Apr 16, 2014, 2:51:08 PM4/16/14
to rob....@samsung.com, blink-...@chromium.org, bemjb+r...@chromium.org, dsin...@chromium.org, zol...@webkit.org, eae+bli...@chromium.org, leviw+re...@chromium.org, jchaffraix...@chromium.org, p...@chromium.org, rune+...@opera.com

https://codereview.chromium.org/240423005/diff/1/Source/core/rendering/RenderBlock.cpp
File Source/core/rendering/RenderBlock.cpp (right):

https://codereview.chromium.org/240423005/diff/1/Source/core/rendering/RenderBlock.cpp#newcode2769
Source/core/rendering/RenderBlock.cpp:2769: // FIXME: handle REFERENCE
I would do a switch here to make sure you cover all the things.

https://codereview.chromium.org/240423005/diff/1/Source/core/rendering/RenderBlock.cpp#newcode2773
Source/core/rendering/RenderBlock.cpp:2773: if
(!clipPath->path(borderBoxRect()).contains(locationInContainer.point() -
localOffset, clipPath->windRule()))
Not sure if that is a win here. What about checking if the point is in
the bounding box first? It might make it slower though since we do not
need the bounding box anywhere else.

Also, checking path is one way, for things like circle or ellipse and
maybe even rect you don't want that and it is faster to do it yourself.
Not sure how Skia handles these cases though.

https://codereview.chromium.org/240423005/

dsch...@chromium.org

unread,
Apr 16, 2014, 4:08:19 PM4/16/14
to rob....@samsung.com, blink-...@chromium.org, bemjb+r...@chromium.org, dsin...@chromium.org, zol...@webkit.org, eae+bli...@chromium.org, leviw+re...@chromium.org, jchaffraix...@chromium.org, p...@chromium.org, rune+...@opera.com

https://codereview.chromium.org/240423005/diff/20001/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html
File
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html
(right):

https://codereview.chromium.org/240423005/diff/20001/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html#newcode40
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html:40:
shouldBe('window.getSelection().toString()', '"other"');
Can you do a positive check as well? Also, since the patch is clip-path
only, you don't need to have shape inside the demo.

https://codereview.chromium.org/240423005/

rob....@samsung.com

unread,
Apr 18, 2014, 2:18:40 PM4/18/14
to dsch...@chromium.org, blink-...@chromium.org, bemjb+r...@chromium.org, dsin...@chromium.org, zol...@webkit.org, eae+bli...@chromium.org, leviw+re...@chromium.org, jchaffraix...@chromium.org, p...@chromium.org, rune+...@opera.com
Reviewers: krit,

Message:
Done!

Description:
[CSS Shapes] Can't select content within the area of the floating box when
clip-path is applied

According to http://www.w3.org/TR/css-masking-1/, the clipped part of the
element should not have pointer event dispatching. So add this logic to
RenderBlock::nodeAtPoint. This fixes the bug as it disallows selection on
any
clipped parts.

BUG=364153


Please review this at https://codereview.chromium.org/240423005/

SVN Base: https://chromium.googlesource.com/chromium/blink.git@master

Affected files (+115, -0 lines):
A LayoutTests/fast/masking/clip-path-selection.html
A LayoutTests/fast/masking/clip-path-selection-expected.txt
A
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html
A
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-clip-path-selection-expected.txt
M Source/core/rendering/RenderBlock.cpp


Reply all
Reply to author
Forward
0 new messages