Slow CSS selectors in mobile-browser/themes/core

VERIFIED FIXED in Firefox 4.0

Status

VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: mbrubeck, Assigned: mbrubeck)

Tracking

({perf})

Trunk
Firefox 4.0

Details

Attachments

(4 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
All of our CSS files, especially platform.css, contain many rules that violate the guidelines in https://developer.mozilla.org/en/writing_efficient_css
(Assignee)

Comment 1

9 years ago
Created attachment 461019 [details] [diff] [review]
part 1: dialogs, misc platform.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-
(Assignee)

Comment 3

9 years ago
Created attachment 461233 [details] [diff] [review]
part 1: dialogs, v2

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+
(Assignee)

Comment 5

9 years ago
Created attachment 461559 [details] [diff] [review]
part 2: select-list, context menu

Also makes the sharing popup title use the same font size as the context menu title.
Attachment #461559 - Flags: review?(mark.finkle)
(Assignee)

Updated

9 years ago
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+
(Assignee)

Comment 7

9 years ago
Created attachment 461607 [details] [diff] [review]
part 3: content-navigator, buttons
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+

Comment 11

9 years ago
 
> 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
(Assignee)

Comment 12

8 years ago
Created attachment 469634 [details] [diff] [review]
part 4: documenttab

This one is short and sweet.
Attachment #469634 - Flags: review?(mark.finkle)
Attachment #469634 - Flags: review?(mark.finkle) → review+
(Assignee)

Updated

8 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Comment 14

8 years ago
Can someone please verify this or provide me some steps to reproduce so that I can validate it ?

Comment 16

8 years ago
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.