"disabled=true" not working in link for stylesheet at initial load
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: amnon.david, Assigned: emilio)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [webcompat][wptsync upstream])
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Steps to reproduce: <link id='rtl' rel="stylesheet" href="./mypath/mystyle.css" disabled="true"> Actual results: mystyle.css affects the rendered page. Expected results: mystyle.css should have not have any effect on the rendered page. Changing the disabled property via DOM after the page loads fixes this, but it is a workaround and not the correct behaviour Also explained here: http://stackoverflow.com/questions/18237591/firefox-not-adhering-to-disabled-stylesheet
Reporter | ||
Updated•7 years ago
|
Comment 2•7 years ago
|
||
I guess it's a bug; Safari, Chrome and Edge all disable the style sheet when disabled="" is set in content. The HTML spec seems to have lost the disabled attribute on <link> and <style> (filed https://github.com/whatwg/html/issues/1577), but I imagine it should work as the test case expects.
Comment 3•7 years ago
|
||
Though https://github.com/whatwg/html/issues/1081 points out that Firefox doesn't support the disabled="" content attribute at all (just the IDL attribute).
Updated•7 years ago
|
![]() |
||
Updated•5 years ago
|
![]() |
||
Updated•5 years ago
|
![]() |
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
WebKit / Blink behavior for <link rel="stylesheet" disabled>
is a bit fishy, but I'll take a look.
Assignee | ||
Comment 6•5 years ago
|
||
I proposed something in that HTML spec issue.
Assignee | ||
Comment 7•5 years ago
|
||
...instead of forwarding to the sheet like HTMLStyleElement does.
I've proposed this behavior in:
https://github.com/whatwg/html/issues/3840#issuecomment-480894419
I think this is one of the sane behaviors we can have, what Blink / WebKit do
makes no sense to me.
Alternative potentially-sane behavior is making the initial value of the
stylesheet's disabled bit the same as the content attribute, and both reflect
and forward the attribute from the setter.
That means that setAttribute does something different than setting disabled
,
which means that you can get into all sorts of funny states when reloading the
sheet... So I rather not do that.
Updated•5 years ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef991fe893a4 Make <link disabled> work and HTMLLinkElement.disabled reflect that attribute. r=bzbarsky
Comment 9•5 years ago
|
||
Backed out changeset ef991fe893a4 (Bug 1281135) for failures in browser_bug839103.js
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&selectedJob=241381337&revision=ef991fe893a435f4416bde5f518135655a9740e1
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=241381337&repo=autoland&lineNumber=1699
Backout: https://hg.mozilla.org/integration/autoland/rev/0ca59c12ed2a1c6d5aec3cd06b274a18cfab26e8
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/edbf9758ea94 Make <link disabled> work and HTMLLinkElement.disabled reflect that attribute. r=bzbarsky
Comment 11•5 years ago
|
||
bugherder |
Comment 12•5 years ago
|
||
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/mozilla-inbound/rev/e0e8a1c9dc1d followup: Address a review comment on a test.
Comment 13•5 years ago
|
||
bugherder |
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16521 for changes under testing/web-platform/tests
Comment 15•4 years ago
|
||
Documentation has been updated:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
Changes include moving the disabled
attribute from the obsolete properties section up into the main list, and updating the text to describe the behavior implemented by this spec change.
BCD data update has been submitted and is pending review:
https://github.com/mdn/browser-compat-data/pull/4323
Reviews appreciated; feel free to correct any errors yourself or point them out to me.
Assignee | ||
Comment 16•4 years ago
|
||
Thanks Eric, I did some edits (please review if you find some time as English is not my first language), and left a few comments in BCD regarding a misunderstanding between what the old and new behavior is :)
Comment 17•4 years ago
|
||
:emilio -- I am working on an update to the BCD patch which I will submit shortly. I have read your changes to the article and think I see what you're saying there. I did rewrite the text to be more specific on a couple of things (I think) and would appreciate it if you would read it again to be sure I didn't screw up my rewrite. Otherwise, I'll restore your original text and just make minor grammatical tweaks.
Thanks for jumping on the reviewing right away! I very much appreciate it!
Description
•