Changeset 236384 in webkit


Ignore:
Timestamp:
Sep 22, 2018 1:13:52 AM (6 years ago)
Author:
rniwa@webkit.org
Message:

Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
https://bugs.webkit.org/show_bug.cgi?id=136836

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by simply generalizing the existing code path existed for video / input type=color.

Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html

fast/shadow-dom/dragging-element-with-shadow-tree.html

  • page/DragController.cpp:

(WebCore::DragController::startDrag):

LayoutTests:

Added regression tests for dragging a element with a shadow tree, which is fixed in this bug
as well as dragging an element inside a shadow tree, which was already functional but had no tests.

  • TestExpectations:
  • fast/shadow-dom/dragging-element-inside-shadow-tree-expected.txt: Added.
  • fast/shadow-dom/dragging-element-inside-shadow-tree.html: Added.
  • fast/shadow-dom/dragging-element-with-shadow-tree-expected.txt: Added.
  • fast/shadow-dom/dragging-element-with-shadow-tree.html: Added.
  • platform/ios/TestExpectations: Don't mark the entirety of fast/shadow-dom as PASS.
  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236380 r236384  
     12018-09-21  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
     4        https://bugs.webkit.org/show_bug.cgi?id=136836
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Added regression tests for dragging a element with a shadow tree, which is fixed in this bug
     9        as well as dragging an element inside a shadow tree, which was already functional but had no tests.
     10
     11        * TestExpectations:
     12        * fast/shadow-dom/dragging-element-inside-shadow-tree-expected.txt: Added.
     13        * fast/shadow-dom/dragging-element-inside-shadow-tree.html: Added.
     14        * fast/shadow-dom/dragging-element-with-shadow-tree-expected.txt: Added.
     15        * fast/shadow-dom/dragging-element-with-shadow-tree.html: Added.
     16        * platform/ios/TestExpectations: Don't mark the entirety of fast/shadow-dom as PASS.
     17        * platform/mac-wk1/TestExpectations:
     18
    1192018-09-21  Devin Rousso  <drousso@apple.com>
    220
  • trunk/LayoutTests/TestExpectations

    r236292 r236384  
    105105editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html [ Skip ]
    106106editing/pasteboard/file-input-files-access-promise.html [ Skip ]
     107fast/shadow-dom/dragging-element-with-shadow-tree.html [ Skip ]
     108fast/shadow-dom/dragging-element-inside-shadow-tree.html [ Skip ]
    107109http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html [ Skip ]
    108110
  • trunk/LayoutTests/platform/ios/TestExpectations

    r236274 r236384  
    779779editing/inserting/smart-quote-with-all-configurations.html [ Skip ]
    780780
    781 webkit.org/b/148695 fast/shadow-dom [ Pass ]
    782 
    783781# No tab navigation support on iOS
    784782fast/shadow-dom/focus-on-iframe.html [ Failure ]
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r236273 r236384  
    2525editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html [ Pass ]
    2626editing/pasteboard/file-input-files-access-promise.html [ Pass ]
     27fast/shadow-dom/dragging-element-with-shadow-tree.html [ Pass ]
     28fast/shadow-dom/dragging-element-inside-shadow-tree.html [ Pass ]
    2729http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html [ Pass ]
    2830
  • trunk/Source/WebCore/ChangeLog

    r236383 r236384  
     12018-09-21  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
     4        https://bugs.webkit.org/show_bug.cgi?id=136836
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Fixed the bug by simply generalizing the existing code path existed for video / input type=color.
     9
     10        Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html
     11               fast/shadow-dom/dragging-element-with-shadow-tree.html
     12
     13        * page/DragController.cpp:
     14        (WebCore::DragController::startDrag):
     15
    1162018-09-22  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebCore/page/DragController.cpp

    r235775 r236384  
    906906    HitTestResult hitTestResult = src.eventHandler().hitTestResultAtPoint(dragOrigin, HitTestRequest::ReadOnly | HitTestRequest::Active);
    907907
    908     // FIXME(136836): Investigate whether all elements should use the containsIncludingShadowDOM() path here.
    909     bool includeShadowDOM = false;
    910 #if ENABLE(VIDEO)
    911     includeShadowDOM = state.source->isMediaElement();
    912 #endif
    913 #if ENABLE(INPUT_TYPE_COLOR)
    914     bool isColorControl = is<HTMLInputElement>(state.source) && downcast<HTMLInputElement>(*state.source).isColorControl();
    915     includeShadowDOM = includeShadowDOM || isColorControl;
    916 #endif
    917     bool sourceContainsHitNode;
    918     if (!includeShadowDOM)
    919         sourceContainsHitNode = state.source->contains(hitTestResult.innerNode());
    920     else
    921         sourceContainsHitNode = state.source->containsIncludingShadowDOM(hitTestResult.innerNode());
    922 
     908    bool sourceContainsHitNode = state.source->containsIncludingShadowDOM(hitTestResult.innerNode());
    923909    if (!sourceContainsHitNode) {
    924910        // The original node being dragged isn't under the drag origin anymore... maybe it was
     
    11791165
    11801166#if ENABLE(INPUT_TYPE_COLOR)
     1167    bool isColorControl = is<HTMLInputElement>(state.source) && downcast<HTMLInputElement>(*state.source).isColorControl();
    11811168    if (isColorControl && m_dragSourceAction & DragSourceActionColor) {
    11821169        auto& input = downcast<HTMLInputElement>(*state.source);
Note: See TracChangeset for help on using the changeset viewer.