Changeset 27576 in webkit


Ignore:
Timestamp:
Nov 7, 2007, 10:52:09 AM (18 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Darin Adler.

  • fix a bug where CSS rules with :hover in the ancestor chain stopped working after changing the inline style declaration of the ancestor

Test: fast/css/affected-by-hover-after-style-change.html

  • dom/Element.cpp: (WebCore::Element::recalcStyle): If we are not forcing style recalculation for all descendants, preserve any "affected by {hover|active|drag} bits that we may have acquired from them. Also renamed _style to currentStyle.

WebKitSite:

Reviewed by Darin Adler.

  • removed a workaround for the bug fixed in the WebCore part of this patch
  • misc/DatabaseExample.html:

LayoutTests:

Reviewed by Darin Adler.

  • test that CSS rules with :hover in the ancestor chain continue to work after changing the inline style declaration of the ancestor
  • fast/css/affected-by-hover-after-style-change.html: Added.
  • platform/mac/fast/css/affected-by-hover-after-style-change-expected.checksum: Added.
  • platform/mac/fast/css/affected-by-hover-after-style-change-expected.png: Added.
  • platform/mac/fast/css/affected-by-hover-after-style-change-expected.txt: Added.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r27571 r27576  
     12007-11-07  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - test that CSS rules with :hover in the ancestor chain continue to work
     6          after changing the inline style declaration of the ancestor
     7
     8        * fast/css/affected-by-hover-after-style-change.html: Added.
     9        * platform/mac/fast/css/affected-by-hover-after-style-change-expected.checksum: Added.
     10        * platform/mac/fast/css/affected-by-hover-after-style-change-expected.png: Added.
     11        * platform/mac/fast/css/affected-by-hover-after-style-change-expected.txt: Added.
     12
    1132007-11-06  Geoffrey Garen  <ggaren@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r27575 r27576  
     12007-11-07  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix a bug where CSS rules with :hover in the ancestor chain stopped
     6          working after changing the inline style declaration of the ancestor
     7
     8        Test: fast/css/affected-by-hover-after-style-change.html
     9
     10        * dom/Element.cpp:
     11        (WebCore::Element::recalcStyle): If we are not forcing style
     12        recalculation for all descendants, preserve any "affected by
     13        {hover|active|drag} bits that we may have acquired from them.
     14        Also renamed _style to currentStyle.
     15
    1162007-11-06  Timothy Hatcher  <timothy@apple.com>
    217
  • trunk/WebCore/dom/Element.cpp

    r27465 r27576  
    698698{
    699699    // ### should go away and be done in renderobject
    700     RenderStyle* _style = renderStyle();
     700    RenderStyle* currentStyle = renderStyle();
    701701    bool hasParentStyle = parentNode() ? parentNode()->renderStyle() : false;
    702702
     
    712712    if (hasParentStyle && (change >= Inherit || changed())) {
    713713        RenderStyle *newStyle = document()->styleSelector()->styleForElement(this);
    714         StyleChange ch = diff(_style, newStyle);
     714        StyleChange ch = diff(currentStyle, newStyle);
    715715        if (ch == Detach) {
    716716            if (attached())
     
    724724            return;
    725725        }
    726         else if (ch != NoChange) {
     726
     727        if (newStyle && change != Force && styleChangeType() != FullStyleChange && document()->usesDescendantRules()) {
     728            // Preserve "affected by" bits that were propagated to us from descendants
     729            if (currentStyle->affectedByHoverRules())
     730                newStyle->setAffectedByHoverRules(true);
     731            if (currentStyle->affectedByActiveRules())
     732                newStyle->setAffectedByActiveRules(true);
     733            if (currentStyle->affectedByDragRules())
     734                newStyle->setAffectedByDragRules(true);
     735        }
     736
     737        if (ch != NoChange) {
    727738            if (newStyle)
    728739                setRenderStyle(newStyle);
    729         }
    730         else if (changed() && newStyle && (document()->usesSiblingRules() || document()->usesDescendantRules())) {
     740        } else if (changed() && newStyle && (document()->usesSiblingRules() || document()->usesDescendantRules())) {
    731741            // Although no change occurred, we use the new style so that the cousin style sharing code won't get
    732742            // fooled into believing this style is the same.  This is only necessary if the document actually uses
  • trunk/WebKitSite/ChangeLog

    r27432 r27576  
     12007-11-07  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - removed a workaround for the bug fixed in the WebCore part of this
     6          patch
     7
     8        * misc/DatabaseExample.html:
     9
    1102007-11-04  Timothy Hatcher  <timothy@apple.com>
    211
  • trunk/WebKitSite/misc/DatabaseExample.html

    r27358 r27576  
    1717}
    1818
    19 /* FIXME: this empty rule works around a bug in our css handling */
    20 .note:hover { }
    2119.note:hover .closebutton {
    2220    display: block;
Note: See TracChangeset for help on using the changeset viewer.