Changeset 202517 in webkit


Ignore:
Timestamp:
Jun 27, 2016 3:20:17 PM (8 years ago)
Author:
benjamin@webkit.org
Message:

Fix style invalidation for :active when the activated node has no renderer
https://bugs.webkit.org/show_bug.cgi?id=159125

Reviewed by Antti Koivisto.

Source/WebCore:

Same old bug: a style invalidation path was depending
on the style.

Here we really need both flags. An element can have
childrenAffectedByActive() false and renderStyle->affectedByActive() true
if it was subject to style sharing.

The element state "childrenAffectedByActive" should be renamed
"styleAffectedByActive" since it is not a parent invalidation flag.
That will be done separately.

Tests: fast/css/pseudo-active-on-labeled-control-without-renderer.html

fast/css/pseudo-active-style-sharing-1.html
fast/css/pseudo-active-style-sharing-2.html
fast/css/pseudo-active-style-sharing-3.html
fast/css/pseudo-active-style-sharing-4.html
fast/css/pseudo-active-style-sharing-5.html
fast/css/pseudo-active-style-sharing-6.html

  • dom/Element.cpp:

(WebCore::Element::setActive):

  • style/StyleRelations.cpp:

(WebCore::Style::commitRelationsToRenderStyle):

LayoutTests:

There was no bug with style sharing but I wanted that covered anyway.
Style sharing depends on 2 flags which is uncommon.
There was no test coverage whatsoever, breaking it did not fail any test.

  • fast/css/pseudo-active-on-labeled-control-without-renderer-expected.txt: Added.
  • fast/css/pseudo-active-on-labeled-control-without-renderer.html: Added.
  • fast/css/pseudo-active-style-sharing-1-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-1.html: Added.
  • fast/css/pseudo-active-style-sharing-2-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-2.html: Added.
  • fast/css/pseudo-active-style-sharing-3-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-3.html: Added.
  • fast/css/pseudo-active-style-sharing-4-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-4.html: Added.
  • fast/css/pseudo-active-style-sharing-5-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-5.html: Added.
  • fast/css/pseudo-active-style-sharing-6-expected.txt: Added.
  • fast/css/pseudo-active-style-sharing-6.html: Added.
Location:
trunk
Files:
14 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202516 r202517  
     12016-06-27  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Fix style invalidation for :active when the activated node has no renderer
     4        https://bugs.webkit.org/show_bug.cgi?id=159125
     5
     6        Reviewed by Antti Koivisto.
     7
     8        There was no bug with style sharing but I wanted that covered anyway.
     9        Style sharing depends on 2 flags which is uncommon.
     10        There was no test coverage whatsoever, breaking it did not fail any test.
     11
     12        * fast/css/pseudo-active-on-labeled-control-without-renderer-expected.txt: Added.
     13        * fast/css/pseudo-active-on-labeled-control-without-renderer.html: Added.
     14        * fast/css/pseudo-active-style-sharing-1-expected.txt: Added.
     15        * fast/css/pseudo-active-style-sharing-1.html: Added.
     16        * fast/css/pseudo-active-style-sharing-2-expected.txt: Added.
     17        * fast/css/pseudo-active-style-sharing-2.html: Added.
     18        * fast/css/pseudo-active-style-sharing-3-expected.txt: Added.
     19        * fast/css/pseudo-active-style-sharing-3.html: Added.
     20        * fast/css/pseudo-active-style-sharing-4-expected.txt: Added.
     21        * fast/css/pseudo-active-style-sharing-4.html: Added.
     22        * fast/css/pseudo-active-style-sharing-5-expected.txt: Added.
     23        * fast/css/pseudo-active-style-sharing-5.html: Added.
     24        * fast/css/pseudo-active-style-sharing-6-expected.txt: Added.
     25        * fast/css/pseudo-active-style-sharing-6.html: Added.
     26
    1272016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
    228
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r202491 r202517  
    255255fast/events/prevent-default-prevents-interaction-with-scrollbars.html [ Skip ]
    256256fast/text/text-disappear-on-deselect.html [ ImageOnlyFailure ]
     257fast/css/pseudo-active-on-labeled-control-without-renderer.html [ Skip ]
    257258fast/css/pseudo-active-on-labeled-element-not-canceled-by-focus.html [ Skip ]
     259fast/css/pseudo-active-style-sharing-1.html [ Skip ]
     260fast/css/pseudo-active-style-sharing-2.html [ Skip ]
     261fast/css/pseudo-active-style-sharing-3.html [ Skip ]
     262fast/css/pseudo-active-style-sharing-4.html [ Skip ]
     263fast/css/pseudo-active-style-sharing-5.html [ Skip ]
     264fast/css/pseudo-active-style-sharing-6.html [ Skip ]
    258265fast/css/pseudo-active-with-programmatic-focus.html [ Skip ]
    259266
  • trunk/Source/WebCore/ChangeLog

    r202516 r202517  
     12016-06-27  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Fix style invalidation for :active when the activated node has no renderer
     4        https://bugs.webkit.org/show_bug.cgi?id=159125
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Same old bug: a style invalidation path was depending
     9        on the style.
     10
     11        Here we really need both flags. An element can have
     12        childrenAffectedByActive() false and renderStyle->affectedByActive() true
     13        if it was subject to style sharing.
     14
     15        The element state "childrenAffectedByActive" should be renamed
     16        "styleAffectedByActive" since it is not a parent invalidation flag.
     17        That will be done separately.
     18
     19        Tests: fast/css/pseudo-active-on-labeled-control-without-renderer.html
     20               fast/css/pseudo-active-style-sharing-1.html
     21               fast/css/pseudo-active-style-sharing-2.html
     22               fast/css/pseudo-active-style-sharing-3.html
     23               fast/css/pseudo-active-style-sharing-4.html
     24               fast/css/pseudo-active-style-sharing-5.html
     25               fast/css/pseudo-active-style-sharing-6.html
     26
     27        * dom/Element.cpp:
     28        (WebCore::Element::setActive):
     29        * style/StyleRelations.cpp:
     30        (WebCore::Style::commitRelationsToRenderStyle):
     31
    1322016-06-27  Joanmarie Diggs  <jdiggs@igalia.com>
    233
  • trunk/Source/WebCore/dom/Element.cpp

    r202358 r202517  
    554554    document().userActionElements().setActive(this, flag);
    555555
    556     if (!renderer())
    557         return;
    558 
    559     bool reactsToPress = renderStyle()->affectedByActive() || childrenAffectedByActive();
     556    const RenderStyle* renderStyle = this->renderStyle();
     557    bool reactsToPress = (renderStyle && renderStyle->affectedByActive()) || childrenAffectedByActive();
    560558    if (reactsToPress)
    561559        setNeedsStyleRecalc();
     560
     561    if (!renderer())
     562        return;
    562563
    563564    if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::PressedState))
  • trunk/Source/WebCore/style/StyleRelations.cpp

    r202358 r202517  
    5353        case Relation::AffectedByActive:
    5454            style.setAffectedByActive();
     55            appendStyleRelation(relation);
    5556            break;
    5657        case Relation::AffectedByDrag:
Note: See TracChangeset for help on using the changeset viewer.