[webkit-reviews] review granted: [Bug 76701] Use content-language from http-equiv to set document locale and font : [Attachment 124085] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 26 09:24:30 PST 2012


Darin Adler <darin at apple.com> has granted Matt Falkenhagen
<falken at chromium.org>'s request for review:
Bug 76701: Use content-language from http-equiv to set document locale and font
https://bugs.webkit.org/show_bug.cgi?id=76701

Attachment 124085: Patch
https://bugs.webkit.org/attachment.cgi?id=124085&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=124085&action=review


> Source/WebCore/dom/Document.cpp:1099
> +    m_contentLanguage = language;
> +    recalcStyle(Force);

Since recalcStyle is a heavyweight operation, there are a few things I suggest
doing:

1) If m_contentLanguage is already equal to the new value for language, return
without doing any further .

2) Your comment in the bug explained why this call to recalcStyle is needed.
The code needs a similar comment.

3) Investigate the idiom further. This is almost certainly wrong. Synchronously
calculating style happens in a few places, but none of them make clear why the
normal model does not apply. The normal model is that style is calculated as
part of the painting or hit testing process or as part of an operation that
asks about style. Changes invalidate style, but don’t synchronously recalculate
it. For example, Document::setVisuallyOrdered does not call recalcStyle(Force).
Document::setDesignMode calls scheduleForcedStyleRecalc rather than actually
calling recalcStyle. Changing preferences that affect default fonts calls
styleSelectorChanged(DeferRecalcStyle).


More information about the webkit-reviews mailing list