Closed Bug 582676 Opened 9 years ago Closed 9 years ago

Slow CSS selectors in mobile-browser/themes/core

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 4.0

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

(Keywords: perf)

Attachments

(4 files, 1 obsolete file)

All of our CSS files, especially platform.css, contain many rules that violate the guidelines in https://developer.mozilla.org/en/writing_efficient_css
Since I was already mucking with the dialog styles for bug 582706...

- Removed close buttons from content/prompt/*.xul.  The styles were using slow selectors, and we don't actually display the buttons ever.

- All <dialog> elements in Fennec are loaded by importDialog which always adds a .modal-block container, so ".modal-block dialog" is redundant.

- Clean up some miscellaneous descendant selectors.
Assignee: administration → mbrubeck
Status: NEW → ASSIGNED
Attachment #461019 - Flags: review?(mark.finkle)
Comment on attachment 461019 [details] [diff] [review]
part 1: dialogs, misc platform.css


>diff -r 95ec6d359a5a themes/core/platform.css

>-dialog .prompt-header {
>+.prompt-header {

>-dialog .prompt-title {
>+.prompt-title {

>-  dialog .prompt-header {
>+  .prompt-header {

>-  dialog .prompt-title {
>+  .prompt-title {

>-dialog .prompt-message {
>+.prompt-message {
>   margin-top: 8px;

>-dialog .button-checkbox {
>+.prompt-header > .button-checkbox {

I'm a little worried about collisions from add-ons on these. I'd rather add the direct lineage as needed and keep them a bit more explicit and not so general purpose.
Attachment #461019 - Flags: review?(mark.finkle) → review-
Use more specific selectors for dialog parts.
Attachment #461019 - Attachment is obsolete: true
Attachment #461233 - Flags: review?(mark.finkle)
Attachment #461233 - Flags: review?(mark.finkle) → review+
Also makes the sharing popup title use the same font size as the context menu title.
Attachment #461559 - Flags: review?(mark.finkle)
Blocks: 583280
Comment on attachment 461559 [details] [diff] [review]
part 2: select-list, context menu

As I mentioned before, we just need to be careful we don't end up with a too general class name for some of these selectors. Add-ons could also be using short simple class names too and break us.

These changes look OK. "context-command" is getting close to the edge though.
Attachment #461559 - Flags: review?(mark.finkle) → review+
Attachment #461607 - Flags: review?(mark.finkle)
Comment on attachment 461607 [details] [diff] [review]
part 3: content-navigator, buttons


>     <!-- options dialog for select form field -->
>     <vbox id="select-container" hidden="true" pack="center">
>-      <spacer flex="1000"/>
>+      <spacer flex="1000" id="select-spacer"/>

id before flex, please

>diff -r f058076d4162 chrome/content/prompt/alert.xul

>   <hbox class="prompt-buttons">
>-    <button id="prompt-button-ok" label="&ok.label;" command="cmd_ok"/>
>+    <button class="prompt-button" id="prompt-button-ok" label="&ok.label;" command="cmd_ok"/>

id before name, please


r+ with nits
Attachment #461607 - Flags: review?(mark.finkle) → review+
 
> As I mentioned before, we just need to be careful we don't end up with a too
> general class name for some of these selectors. Add-ons could also be using
> short simple class names too and break us.

 That's true, and this is documented in the mobile add-ons guide in the wiki  (https://wiki.mozilla.org/Mobile/Fennec/Extensions/BestPractices#Conflicts). I guess we are fine with the current patch
This one is short and sweet.
Attachment #469634 - Flags: review?(mark.finkle)
Attachment #469634 - Flags: review?(mark.finkle) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Can someone please verify this or provide me some steps to reproduce so that I can validate it ?
VERIFIED FIXED on:

Build ID: Mozilla/5.0 (Maemo; Linux armv7l; rv:6.0a1) Gecko/20110510
Firefox/6.0a1 Fennec/6.0a1

Mozilla /5.0 (Android;Linux armv7l;rv:6.0a1) Gecko/20110515 Firefox/6.0a1 Fennec/6.0a1 


Mozilla /5.0 (Android;Linux armv7l;rv:5.0a1) Gecko/20110515 Firefox/5.0a2 Fennec/5.0a2 

Devices: Nokia N900(Maemo GTK), HTC Desire Z (Android 2.2)
Status: RESOLVED → VERIFIED
Target Milestone: --- → Firefox 4.0
You need to log in before you can comment on or make changes to this bug.