Closed
Bug 894874
Opened 12 years ago
Closed 12 years ago
document.selectedStyleSheetSet erroneously reports empty string
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: glazou, Assigned: bzbarsky)
References
Details
(Keywords: regression)
Attachments
(2 files)
|
1.09 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.31 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce the bug:
1. open http://www.w3.org/Style/Examples/007/alternatives.en.html
2. open the Browser console
3. use View > Page Style to select an alternate stylesheet
4. type getBrowser().contentDocument.selectedStyleSheetSet
in the Browser console to see if the name of the selected style set
is correctly reported
EXPECTED RESULT: selected style set is always correctly reported
ACTUAL RESULT: result is correct for style sets "Main", "Cascade",
"Cascade (older browsers)", "Draft 3", "Draft 2" and
is the empty string for all other alternate style sets
defined by the document: "Oldstyle", "Modernist", "Midnight",
"Ultramarine", "Swiss", "Chocolate", "Traditional", "Steely",
"Forest (by David Baron)" and "Plain (by David Baron)"
I have no idea if this is related or not, but the <link> elements for the
style sets reporting an empty string use an absolute URL while the ones
reporting correctly the style set's title use a relative one.
Tested with Nightly 25.0a1 (2013-07-16, built from http://hg.mozilla.org/mozilla-central/rev/5976b9c673f8)
| Reporter | ||
Comment 1•12 years ago
|
||
FWIW, the View > Page Style menu reports correctly the selected style set
because it's not at all based on the API mentioned above.
| Reporter | ||
Comment 2•12 years ago
|
||
Ok, the guilty code is in nsIDocument::GetSelectedStyleSheetSet. The URL
referenced above links a stylesheet between the ones reporting
correctly the styleset and the one erroneously reporting it and that
sheet has no title attribute. But the code does not deal with that case
and returns an empty title...
| Assignee | ||
Comment 3•12 years ago
|
||
No, that patch is wrong.
This is a regression from bug 804631. The relevant bogus part of that diff:
if (aSheetSet.IsEmpty()) {
aSheetSet = title;
- } else if (!title.IsEmpty() && !aSheetSet.Equals(title)) {
+ return;
+ }
+
+ if (!title.IsEmpty() && !aSheetSet.Equals(title)) {
| Assignee | ||
Comment 4•12 years ago
|
||
Attachment #777131 -
Flags: review?(bugs)
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Comment 5•12 years ago
|
||
Comment on attachment 777131 [details] [diff] [review]
Fix .selectedStyleSheetSet to consider all the sheets even after it finds an enabled sheet.
Odd API
Attachment #777131 -
Flags: review?(bugs) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla25
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 8•12 years ago
|
||
I was about to report this regression. Could you fix it also in Gecko 24?
tracking-firefox24:
--- → ?
Keywords: regression
| Assignee | ||
Comment 9•12 years ago
|
||
It's a simple enough backport. I didn't worry about it too much because it had been shipping for something like 3 releases already (20, 21, 22) and this API is not exactly well-supported in browsers so doesn't affect web compat much (clearly, since we shipped it for several releases...).
Feel free to request branch approval and make a case for it, though.
Comment 10•12 years ago
|
||
Not a tracking bug given its an old regression, we may take an uplift to beta depending on the risk evaluation and the Beta timeline.
tracking-firefox24:
? → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•