Closed Bug 567472 Opened 12 years ago Closed 12 years ago

content.css performance issues


(Firefox for Android Graveyard :: General, defect)

Windows 7
Not set


(Not tracked)



(Reporter: crowderbt, Assigned: vingtetun)



(1 file)

looking through content.css the other day with dbaron, he suggested that we may have some relatively serious performance issues in content.css.  For example:

<dbaron> "html e" selectors are much slower than "e"; did you really want namespaces instead of descendant combinators?

We may have other issues, this is definitely worth auditing.
we don't really want "html e" selectors, I've start a patch (on bug 562031) to remove them a few ago but I need to update it.
Attached patch PatchSplinter Review
Remove all the "html e" rules but prevent content.css to apply to the textbox inner input text.
Attachment #447501 - Flags: review?(mark.finkle)
Attachment #447501 - Flags: review?(dbaron)
Comment on attachment 447501 [details] [diff] [review]

Code works well on the few widget test site we have and on live web sites.

Looks like you are minimizing the use of the "html" namespace too.

We don't have a good to test pageload speed due to the changes, but it can't be slower than what it was.
Attachment #447501 - Flags: review?(mark.finkle) → review+
Comment on attachment 447501 [details] [diff] [review]

This seems like a big improvement, so r=dbaron.

However, it would simplify things a bit if you declared the html namespace as the default namespace:

@namespace url(...);

, dropped all the "html|", and then declared the xul namespace and used xul| for the scrollbar-related rules (which looks like the only place that really wants to style anything non-html).  I think that would also be slightly more correct since there are a few places where you're styling elements in any namespace, which is wrong (in so far as we care about Web content in somebody's-random-XML-dialect).  So I'd recommend that as well.
Attachment #447501 - Flags: review?(dbaron) → review+
Assignee: nobody → 21
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.