[Webkit-unassigned] [Bug 36303] Inserting CSS rules one at a time via js causes slow synchronous style recalculation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 19 14:18:37 PDT 2010


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





--- Comment #8 from Dave Hyatt <hyatt at apple.com>  2010-05-19 14:18:36 PST ---
Also, lots of extra { } in if statements that should be removed.

Also, the placement of updateStyleSelectorIfDirty is bad.  It should happen before the recalcStyle, and the recalcStyle should not happen if the updateStyleSelector ran.

You should make a new helper function that combines the updateStyleSelector check with this code:

    // Always ensure our style info is up-to-date.  This can happen in situations where
    // the layout beats any sort of style recalc update that needs to occur.
    if (m_frame->needsReapplyStyles())
        m_frame->reapplyStyles();
    else if (document->childNeedsStyleRecalc())
        document->recalcStyle();

The logic should be something like:

if (m_styleSelectorDirty)
  updateStyleSelector();
else if (m_frame->needsReapplyStyles())
  etc.

-- 
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