Interoperability and Compatibility
This change is not without risks, since code that interacts with properties on CSSStyleDeclaration is now subtly different. For example, code that relies on Object.defineProperty to set style attributes will "silently" no longer work. (See the app_view.js diff for an example where this broke our own JS).
This risk is mitigated by the fact that anything that is broken by this change is already broken in Firefox, so any (new) breakage should be limited to browser-sniffing cases or Chrome-specific code.
Unfortunately there is no (known) way of adding a use-counter or otherwise estimating the breakage in this case.
Gecko: Shipped/ShippingWebKit: Made the same change in October last year: https://trac.webkit.org/changeset/268564/webkit
Unfortunately the change was later reverted due to binary size issues. However, this shows that the intent to change is there.
Web developers: No signals
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKFBnUq4JLkos4z5EfbNfOc%2BHbRgjaYHrC-ENRaoJi34GtX7dA%40mail.gmail.com.
In principle, this seems like the right thing to do.Practically, given that WebKit made the change, reverted it due to binary size increases, and hasn't tried again in the last ~4 months, and that we found breakage in the past that relied on Chrome's behavior: did you consider making the wrong thing the right thing by asking Gecko to align with WebKit and Blink? How terrible would it be if we did that instead?-mike
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f7aae244-c140-4f34-828a-d35aa79ffa47n%40chromium.org.
Non-owner LGTM. Maybe you can give the WebKit folks a heads up about this change (after 3xLGTM) if they want to try again?
On Thu, Feb 18, 2021 at 9:30 PM Alex Russell <sligh...@chromium.org> wrote:From a pure architectural perspective, I'd like to see us pursue this (assuming the performance issues can be overcome).
Bye,
Rego
To summarize on why this change is good:
- The current interop situation is not great, and a real pain point for authors:
- Comment
- Article excerpt: [Getting a list of all CSS properties from the browser: ] In Chrome and Safari, this is as simple as Object.getOwnPropertyNames(document.body.style). However, in Firefox, this doesn’t work. Why is that? To understand this (and how to work around it), we need to dig a bit deeper". (Pretty sad that it is necessary to write an article about this).
On Thursday, February 25, 2021 at 11:19:37 AM UTC+1 and...@chromium.org wrote:To summarize on why this change is good:
- The current interop situation is not great, and a real pain point for authors:
- Comment
- Article excerpt: [Getting a list of all CSS properties from the browser: ] In Chrome and Safari, this is as simple as Object.getOwnPropertyNames(document.body.style). However, in Firefox, this doesn’t work. Why is that? To understand this (and how to work around it), we need to dig a bit deeper". (Pretty sad that it is necessary to write an article about this).
Doesn't this support the opposite view? (that the current Chromium implementation is simpler to use)
On Thursday, February 25, 2021 at 11:19:37 AM UTC+1 and...@chromium.org wrote:To summarize on why this change is good:
- The current interop situation is not great, and a real pain point for authors:
- Comment
- Article excerpt: [Getting a list of all CSS properties from the browser: ] In Chrome and Safari, this is as simple as Object.getOwnPropertyNames(document.body.style). However, in Firefox, this doesn’t work. Why is that? To understand this (and how to work around it), we need to dig a bit deeper". (Pretty sad that it is necessary to write an article about this).
Doesn't this support the opposite view? (that the current Chromium implementation is simpler to use)(Ah, that's unfortunate, I didn't see that interpretation).No, I don't think this is support for the current way. I think "simple" is used here in a trivial way because Object.getOwnPropertyNames(document.body.style) is shorter than Object.getOwnPropertyNames(Object.getPrototypeOf(document.body.style)).
On Thu, Feb 25, 2021 at 1:24 PM Anders Hartvoll Ruud <and...@chromium.org> wrote:On Thursday, February 25, 2021 at 11:19:37 AM UTC+1 and...@chromium.org wrote:To summarize on why this change is good:
- The current interop situation is not great, and a real pain point for authors:
- Comment
- Article excerpt: [Getting a list of all CSS properties from the browser: ] In Chrome and Safari, this is as simple as Object.getOwnPropertyNames(document.body.style). However, in Firefox, this doesn’t work. Why is that? To understand this (and how to work around it), we need to dig a bit deeper". (Pretty sad that it is necessary to write an article about this).
Doesn't this support the opposite view? (that the current Chromium implementation is simpler to use)(Ah, that's unfortunate, I didn't see that interpretation).No, I don't think this is support for the current way. I think "simple" is used here in a trivial way because Object.getOwnPropertyNames(document.body.style) is shorter than Object.getOwnPropertyNames(Object.getPrototypeOf(document.body.style)).Thanks for outlining the differences! Both indeed seem simple enough.The question I have in the back of my mind on this is "Will WebKit follow?"Might be worthwhile to ask them directly (and maybe point them to the binding magic the team did to reduce the binary size impact)
LGTM2.I agree with Alex that this is the right direction, and if WebKit is going to try again, it's worth shipping it ourselves.-mikeOn Mon, Mar 1, 2021 at 9:11 PM Anders Hartvoll Ruud <and...@chromium.org> wrote:On Thu, Feb 25, 2021 at 4:30 PM Yoav Weiss <yo...@yoav.ws> wrote:On Thu, Feb 25, 2021 at 1:24 PM Anders Hartvoll Ruud <and...@chromium.org> wrote:On Thursday, February 25, 2021 at 11:19:37 AM UTC+1 and...@chromium.org wrote:To summarize on why this change is good:
- The current interop situation is not great, and a real pain point for authors:
- Comment
- Article excerpt: [Getting a list of all CSS properties from the browser: ] In Chrome and Safari, this is as simple as Object.getOwnPropertyNames(document.body.style). However, in Firefox, this doesn’t work. Why is that? To understand this (and how to work around it), we need to dig a bit deeper". (Pretty sad that it is necessary to write an article about this).
Doesn't this support the opposite view? (that the current Chromium implementation is simpler to use)(Ah, that's unfortunate, I didn't see that interpretation).No, I don't think this is support for the current way. I think "simple" is used here in a trivial way because Object.getOwnPropertyNames(document.body.style) is shorter than Object.getOwnPropertyNames(Object.getPrototypeOf(document.body.style)).Thanks for outlining the differences! Both indeed seem simple enough.The question I have in the back of my mind on this is "Will WebKit follow?"Might be worthwhile to ask them directly (and maybe point them to the binding magic the team did to reduce the binary size impact)I got a confirmation from weinig@apple that they still intend to make the change: (Slack messages included inline for the lazy):