"disabled=true" not working in link for stylesheet at initial load

RESOLVED FIXED in Firefox 68

Status

()

defect
P3
normal
RESOLVED FIXED
3 years ago
9 days ago

People

(Reporter: amnon.david, Assigned: emilio)

Tracking

({dev-doc-complete})

47 Branch
mozilla68
x86_64
macOS
Points:
---
Bug Flags:
webcompat ?

Firefox Tracking Flags

(firefox68 fixed)

Details

(Whiteboard: [webcompat][wptsync upstream])

Attachments

(1 attachment)

Reporter

Description

3 years ago
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

3 years ago
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64

Updated

3 years ago
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Cameron, what do you think?
Flags: needinfo?(cam)
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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(cam)
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).
Priority: -- → P3

Updated

3 years ago
Duplicate of this bug: 1318733
Flags: webcompat?
Whiteboard: [webcompat]
Summary: "disabled=true" not working in link for stylesheet → "disabled=true" not working in link for stylesheet at initial load

Updated

3 months ago
Component: DOM: Core & HTML → DOM: CSS Object Model
Assignee

Comment 5

3 months ago

WebKit / Blink behavior for <link rel="stylesheet" disabled> is a bit fishy, but I'll take a look.

Flags: needinfo?(emilio)
Assignee

Comment 6

3 months ago

I proposed something in that HTML spec issue.

Assignee: nobody → emilio
Flags: needinfo?(emilio)
Assignee

Comment 7

3 months 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.

Comment 8

2 months 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
Assignee

Updated

2 months ago
Flags: needinfo?(emilio)

Comment 10

2 months 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

2 months ago
bugherder
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

Comment 12

2 months ago
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0e8a1c9dc1d
followup: Address a review comment on a test.
Regressions: 1546707
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16521 for changes under testing/web-platform/tests
Whiteboard: [webcompat] → [webcompat][wptsync upstream]

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.

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 :)

: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!

Flags: needinfo?(emilio)

Commented there, thank you :)

Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.