[webkit-changes] [13460] trunk/WebCore

Allan Sandfeld Jensen kde at carewolf.com
Mon Apr 24 14:32:35 PDT 2006


Hi

I've adopted and expanded on this patch

Please notice that returning Inherited or Detach is wastefull when only 
pseudo-styles change. Only NoInherit is needed.
Also note you may want to expand it to include SELECTION, but that it requires 
minor adjustments in RenderStyle::diff() for selections to update as well.

Greetings
`Allan

On Thursday 23 March 2006 23:27, bdakin at opensource.apple.com wrote:
> Revision
> 13460
> Author
> bdakin
> Date
> 2006-03-23 14:27:49 -0800 (Thu, 23 Mar 2006)
> Log Message
>         Reviewed by Darin
>
>         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6431
>         REGRESSION: style change where :hover changes only an :after style
>         doesn't work
>
>         * dom/Node.cpp:
>         (WebCore::Node::diff): Need to call diff() on the before and after
>         styles if we have them.
> Modified Paths
> trunk/WebCore/ChangeLog
> trunk/WebCore/dom/Node.cpp
> Diff
>
> Modified: trunk/WebCore/ChangeLog (13459 => 13460)
>
> --- trunk/WebCore/ChangeLog     2006-03-23 22:07:37 UTC (rev 13459)
> +++ trunk/WebCore/ChangeLog     2006-03-23 22:27:49 UTC (rev 13460)
> @@ -1,3 +1,15 @@
> +2006-03-23  Beth Dakin  <bdakin at apple.com>
> +
> +        Reviewed by Darin
> +
> +        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6431
> +        REGRESSION: style change where :hover changes only an :after style
> +        doesn't work
> +
> +        * dom/Node.cpp:
> +        (WebCore::Node::diff): Need to call diff() on the before and after
> +        styles if we have them.
> +
>  2006-03-23  Adele Peterson  <adele at apple.com>
>
>          Reviewed by Hyatt.
>
>
> Modified: trunk/WebCore/dom/Node.cpp (13459 => 13460)
>
> --- trunk/WebCore/dom/Node.cpp  2006-03-23 22:07:37 UTC (rev 13459)
> +++ trunk/WebCore/dom/Node.cpp  2006-03-23 22:27:49 UTC (rev 13460)
> @@ -626,17 +626,26 @@
>      // style in cases where you need to.
>      StyleChange ch = NoInherit;
>      EDisplay display1 = s1 ? s1->display() : NONE;
> -    bool fl1 = s1 ? s1->hasPseudoStyle(RenderStyle::FIRST_LETTER) : false;
> +    bool fl1 = s1 && s1->hasPseudoStyle(RenderStyle::FIRST_LETTER);
>      EDisplay display2 = s2 ? s2->display() : NONE;
> -    bool fl2 = s2 ? s2->hasPseudoStyle(RenderStyle::FIRST_LETTER) : false;
> +    bool fl2 = s2 && s2->hasPseudoStyle(RenderStyle::FIRST_LETTER);
> +
>      if (display1 != display2 || fl1 != fl2)
>          ch = Detach;
> -    else if ( !s1 || !s2 )
> +    else if (!s1 || !s2)
>          ch = Inherit;
> -    else if ( *s1 == *s2 )
> +    else if (*s1 == *s2)
>          ch = NoChange;
> -    else if ( s1->inheritedNotEqual( s2 ) )
> +    else if (s1->inheritedNotEqual(s2))
>          ch = Inherit;
> +
> +    // If the pseudoStyles have changed, we want any StyleChange that is
> not NoChange +    // because setStyle will do the right thing with anything
> else. +    if (ch == NoChange && s1->hasPseudoStyle(RenderStyle::BEFORE)) +
>        ch = diff(s1->getPseudoStyle(RenderStyle::BEFORE),
> s2->getPseudoStyle(RenderStyle::BEFORE)); +    if (ch == NoChange &&
> s1->hasPseudoStyle(RenderStyle::AFTER)) +        ch =
> diff(s1->getPseudoStyle(RenderStyle::AFTER),
> s2->getPseudoStyle(RenderStyle::AFTER)); +
>      return ch;
>  }



More information about the webkit-changes mailing list