[Webkit-unassigned] [Bug 80794] :first-line pseudo selector ignoring words created from :before

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 18:28:14 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=80794





--- Comment #11 from Elliott Sprehn <esprehn at chromium.org>  2012-10-01 18:28:35 PST ---
(From update of attachment 163788)
View in context: https://bugs.webkit.org/attachment.cgi?id=163788&action=review

> Source/WebCore/rendering/RenderObject.cpp:2608
> +    UnCached

Uncached

> Source/WebCore/rendering/RenderObject.cpp:2611
> +static PassRefPtr<RenderStyle> getFirstLineStyle(StyleCacheState type, const RenderObject* renderer, RenderStyle* style)

Can we make this a

> Source/WebCore/rendering/RenderObject.cpp:2620
> +                result = firstLineBlock->getUncachedPseudoStyle(FIRST_LINE, style, firstLineBlock == renderer ? style : 0);

These should use early returns:

if (type == Cached)
  return ...;
return ...;

It's a lot shorter that way too.

> Source/WebCore/rendering/RenderObject.cpp:2637
> +                result = firstLineBlock->getUncachedPseudoStyle(FIRST_LINE, style, firstLineBlock == renderer ? style : 0);

Use early returns and get rid of the RefPtr<RenderStyle> result

> Source/WebCore/rendering/RenderObject.cpp:2657
> +    if (RefPtr<RenderStyle> style = getFirstLineStyle(Cached, isText() ? parent() : this, m_style.get()))

This is super weird that the Cached case is considered the slow one. Any idea what's up with that?

--- Comment #12 from Elliott Sprehn <esprehn at chromium.org>  2012-10-01 18:28:36 PST ---
(From update of attachment 163788)
View in context: https://bugs.webkit.org/attachment.cgi?id=163788&action=review

> Source/WebCore/rendering/RenderObject.cpp:2608
> +    UnCached

Uncached

> Source/WebCore/rendering/RenderObject.cpp:2611
> +static PassRefPtr<RenderStyle> getFirstLineStyle(StyleCacheState type, const RenderObject* renderer, RenderStyle* style)

Can we make this a

> Source/WebCore/rendering/RenderObject.cpp:2620
> +                result = firstLineBlock->getUncachedPseudoStyle(FIRST_LINE, style, firstLineBlock == renderer ? style : 0);

These should use early returns:

if (type == Cached)
  return ...;
return ...;

It's a lot shorter that way too.

> Source/WebCore/rendering/RenderObject.cpp:2637
> +                result = firstLineBlock->getUncachedPseudoStyle(FIRST_LINE, style, firstLineBlock == renderer ? style : 0);

Use early returns and get rid of the RefPtr<RenderStyle> result

> Source/WebCore/rendering/RenderObject.cpp:2657
> +    if (RefPtr<RenderStyle> style = getFirstLineStyle(Cached, isText() ? parent() : this, m_style.get()))

This is super weird that the Cached case is considered the slow one. Any idea what's up with that?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list