Changeset 150868 in webkit


Ignore:
Timestamp:
May 29, 2013 12:18:05 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Regions] Mouse over an element does not trigger :hover state for parent when the element is flowed in a region
https://bugs.webkit.org/show_bug.cgi?id=111749

Patch by Radu Stavila <stavila@adobe.com> on 2013-05-29
Reviewed by Antti Koivisto.

Source/WebCore:

When searching for the hover ancestor and encountering a named flow thread,
the search will continue with the DOM ancestor of the top-most element
in the named flow thread.

Tests: fast/regions/hover-in-region-grandparent.html

fast/regions/hover-in-region-parent-skip.html
fast/regions/hover-in-region-parent-skip-inlines-anonymous.html
fast/regions/hover-on-child-in-region.html
fast/regions/hover-on-child-in-region-in-region.html

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::hoverAncestor):

  • rendering/RenderObject.h:

LayoutTests:

  • fast/regions/hover-in-region-grandparent-expected.txt: Added.
  • fast/regions/hover-in-region-grandparent.html: Added.
  • fast/regions/hover-in-region-parent-skip-expected.txt: Added.
  • fast/regions/hover-in-region-parent-skip.html: Added.
  • fast/regions/hover-in-region-parent-skip-inlines-anonymous-expected.txt: Added.
  • fast/regions/hover-in-region-parent-skip-inlines-anonymous.html: Added.
  • fast/regions/hover-on-child-in-region-expected.txt: Added.
  • fast/regions/hover-on-child-in-region.html: Added.
  • fast/regions/hover-on-child-in-region-in-region-expected.txt: Added.
  • fast/regions/hover-on-child-in-region-in-region.html: Added.
Location:
trunk
Files:
10 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150862 r150868  
     12013-05-29  Radu Stavila  <stavila@adobe.com>
     2
     3        [CSS Regions] Mouse over an element does not trigger :hover state for parent when the element is flowed in a region
     4        https://bugs.webkit.org/show_bug.cgi?id=111749
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/regions/hover-in-region-grandparent-expected.txt: Added.
     9        * fast/regions/hover-in-region-grandparent.html: Added.
     10        * fast/regions/hover-in-region-parent-skip-expected.txt: Added.
     11        * fast/regions/hover-in-region-parent-skip.html: Added.
     12        * fast/regions/hover-in-region-parent-skip-inlines-anonymous-expected.txt: Added.
     13        * fast/regions/hover-in-region-parent-skip-inlines-anonymous.html: Added.
     14        * fast/regions/hover-on-child-in-region-expected.txt: Added.
     15        * fast/regions/hover-on-child-in-region.html: Added.
     16        * fast/regions/hover-on-child-in-region-in-region-expected.txt: Added.
     17        * fast/regions/hover-on-child-in-region-in-region.html: Added.
     18
    1192013-05-28  Dean Jackson  <dino@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r150867 r150868  
     12013-05-29  Radu Stavila  <stavila@adobe.com>
     2
     3        [CSS Regions] Mouse over an element does not trigger :hover state for parent when the element is flowed in a region
     4        https://bugs.webkit.org/show_bug.cgi?id=111749
     5
     6        Reviewed by Antti Koivisto.
     7
     8        When searching for the hover ancestor and encountering a named flow thread,
     9        the search will continue with the DOM ancestor of the top-most element
     10        in the named flow thread.
     11
     12        Tests: fast/regions/hover-in-region-grandparent.html
     13               fast/regions/hover-in-region-parent-skip.html
     14               fast/regions/hover-in-region-parent-skip-inlines-anonymous.html
     15               fast/regions/hover-on-child-in-region.html
     16               fast/regions/hover-on-child-in-region-in-region.html
     17
     18        * rendering/RenderObject.cpp:
     19        (WebCore::RenderObject::hoverAncestor):
     20        * rendering/RenderObject.h:
     21
    1222013-05-28  Nate Chapin  <japhet@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r150547 r150868  
    30433043    imageChanged(static_cast<WrappedImagePtr>(image), rect);
    30443044}
     3045   
     3046RenderObject* RenderObject::hoverAncestor() const
     3047{
     3048    // When searching for the hover ancestor and encountering a named flow thread,
     3049    // the search will continue with the DOM ancestor of the top-most element
     3050    // in the named flow thread.
     3051    // See https://bugs.webkit.org/show_bug.cgi?id=111749
     3052    RenderObject* hoverAncestor = parent();
     3053   
     3054    // Skip anonymous blocks. There's no point in treating them as hover ancestors
     3055    // and it would also prevent us from continuing the search on the DOM tree
     3056    // when reaching the named flow thread.
     3057    if (hoverAncestor && hoverAncestor->isAnonymousBlock())
     3058        hoverAncestor = hoverAncestor->parent();
     3059
     3060    if (hoverAncestor && hoverAncestor->isRenderNamedFlowThread()) {
     3061        hoverAncestor = 0;
     3062       
     3063        Node* node = this->node();
     3064        if (node) {
     3065            Node* domAncestorNode = node->parentNode();
     3066            if (domAncestorNode)
     3067                hoverAncestor = domAncestorNode->renderer();
     3068        }
     3069    }
     3070   
     3071    return hoverAncestor;
     3072}
    30453073
    30463074RenderBoxModelObject* RenderObject::offsetParent() const
  • trunk/Source/WebCore/rendering/RenderObject.h

    r150527 r150868  
    659659    RenderObject* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
    660660
    661     virtual RenderObject* hoverAncestor() const { return parent(); }
     661    virtual RenderObject* hoverAncestor() const;
    662662
    663663    RenderBoxModelObject* offsetParent() const;
Note: See TracChangeset for help on using the changeset viewer.