Skip to content

Conversation

@karlcow
Copy link
Member

@karlcow karlcow commented Dec 26, 2024

7a15673

Remove document.implementation.createCSSStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=285157
rdar://142045904

The code has never been implemented in Firefox
https://bugzilla.mozilla.org/show_bug.cgi?id=63850

This was part of DOM Level 2
https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DOMImplementationCSS

Safari, Firefox and Chrome returns undefined
document.implementation.createCSSStyleSheet

* LayoutTests/fast/css/DOMImplementation.createCSSStyleSheet-obsolete-expected.txt: Removed.
* LayoutTests/fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html: Removed.
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* LayoutTests/webgl/2.0.0/resources/webgl_test_files/deqp/temp_externs/w3c_css.js:
(DOMImplementationCSS.prototype.createCSSStyleSheet): Deleted.
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet): Deleted.
* Source/WebCore/dom/DOMImplementation.h:
* Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:
* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_css_style_sheet): Deleted.
* Source/WebKitLegacy/mac/DOM/DOMImplementation.h:
* Source/WebKitLegacy/mac/DOM/DOMImplementation.mm:
(-[DOMImplementation createCSSStyleSheet:media:]): Deleted.
(-[DOMImplementation createCSSStyleSheet::]): Deleted.

7a15673

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ❌ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ❌ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@karlcow karlcow self-assigned this Dec 26, 2024
@karlcow karlcow added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Dec 26, 2024
Copy link
Contributor

@aproskuryakov aproskuryakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot modify released benchmarks.

Cf. https://bugs.webkit.org/show_bug.cgi?id=171825

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 26, 2024
@karlcow
Copy link
Member Author

karlcow commented Dec 26, 2024

We cannot modify released benchmarks.

Cf. https://bugs.webkit.org/show_bug.cgi?id=171825

yes I thought about it when doing it.
Is there a way to skip the certain tests like for WPT?

https://bugs.webkit.org/show_bug.cgi?id=285157
rdar://142045904

The code has never been implemented in Firefox
https://bugzilla.mozilla.org/show_bug.cgi?id=63850

This was part of DOM Level 2
https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DOMImplementationCSS

Safari, Firefox and Chrome returns undefined
document.implementation.createCSSStyleSheet

* LayoutTests/fast/css/DOMImplementation.createCSSStyleSheet-obsolete-expected.txt: Removed.
* LayoutTests/fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html: Removed.
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* LayoutTests/webgl/2.0.0/resources/webgl_test_files/deqp/temp_externs/w3c_css.js:
(DOMImplementationCSS.prototype.createCSSStyleSheet): Deleted.
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet): Deleted.
* Source/WebCore/dom/DOMImplementation.h:
* Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:
* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_css_style_sheet): Deleted.
* Source/WebKitLegacy/mac/DOM/DOMImplementation.h:
* Source/WebKitLegacy/mac/DOM/DOMImplementation.mm:
(-[DOMImplementation createCSSStyleSheet:media:]): Deleted.
(-[DOMImplementation createCSSStyleSheet::]): Deleted.
@karlcow karlcow removed the merging-blocked Applied to prevent a change from being merged label Dec 27, 2024
@karlcow karlcow force-pushed the 285157-remove-dom-createCSSStyleSheet branch from 2ff87a0 to 7a15673 Compare December 27, 2024 02:14
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 27, 2024
@aproskuryakov
Copy link
Contributor

I don't understand your question. Is it about performance benchmarks?

Another thing we shouldn't be doing is removing WebKitLegacy public APIs.

@karlcow
Copy link
Member Author

karlcow commented Jan 14, 2025

Another thing we shouldn't be doing is removing WebKitLegacy public APIs.

I understand and agree but in this specific case, createCSSStyleSheet() has never been usable, which is why Firefox never implemented it.

see https://bugzilla.mozilla.org/show_bug.cgi?id=63850#c6 from 2002-06-13

This interface allows the DOM user to create a CSSStyleSheet outside the context of a document. There is no way to associate the new CSSStyleSheet with a document in DOM Level 2.

In other words, there is nothing useful you can do with the stylesheet it gives
you.

The missing piece of standard to associate the stylesheet to the DOM was never created. And then later on, it was removed from the spec, when people realized that there is nothing that could be done with it. So I doubt it's in any use elsewhere.

@aproskuryakov
Copy link
Contributor

It's sometimes OK to leave in a stub API with empty implementation, but we can not "clean up" Objective-C APIs.

Comment on lines -108 to -111
- (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title :(NSString *)media
{
return [self createCSSStyleSheet:title media:media];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing all this, use "return nil" as the body instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can remove some of the includes.

@aproskuryakov
Copy link
Contributor

This PR is probably best to be reviewed by @cdumez, as it revisits choices made in his 2017 change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOM For bugs specific to XML/HTML DOM elements (including parsing). merging-blocked Applied to prevent a change from being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants