Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove HTMLHeadElement.profile
Remove HTMLHeadElement.profile
https://bugs.webkit.org/show_bug.cgi?id=249896

Reviewed by Ryosuke Niwa.

This patch is to align with Web-Specifications and other browser engines by removing 'profile' attribute support.

The patch removes "profile" attribute from 'head' element, which
was removed from HTML Specifications in 2010 and later dropped by browsers as
far back as 2014. Currently, only Safari / WebKit support this.

* Source/WebCore/html/HTMLHeadElement.idl: Remove 'profile'
* Source/WebCore/html/HTMLAttributeNames.in: Remove 'profile'
* Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm: Return null for 'profileAttr' & early return for setProfile function
* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
(webkit_dom_html_head_element_get_profile): Return 'nullptr'
(webkit_dom_html_head_element_set_profile): Early return
* LayoutTests/fast/dom/element-attribute-js-null.html: Rebaselined
* LayoutTests/fast/dom/element-attribute-js-null-expected.txt: Rebaselined
* LayoutTests/dom/xhtml/level2/html/HTMLHeadElement01.xhtml: Removed
* LayoutTests/dom/xhtml/level2/html/HTMLHeadElement01.js: Ditto
* LayoutTests/dom/xhtml/level2/html/HTMLHeadElement01-expected.txt: Ditto
* LayoutTests/dom/html/level2/html/HTMLHeadElement01.html: Removed
* LayoutTests/dom/html/level2/html/HTMLHeadElement01.js: Ditto
* LayoutTests/dom/html/level2/html/HTMLHeadElement01-expected.txt: Ditto

Canonical link: https://commits.webkit.org/258397@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Jan 3, 2023
1 parent 64ad5fc commit 4558ead
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 274 deletions.

This file was deleted.

11 changes: 0 additions & 11 deletions LayoutTests/dom/html/level2/html/HTMLHeadElement01.html

This file was deleted.

113 changes: 0 additions & 113 deletions LayoutTests/dom/html/level2/html/HTMLHeadElement01.js

This file was deleted.

This file was deleted.

113 changes: 0 additions & 113 deletions LayoutTests/dom/xhtml/level2/html/HTMLHeadElement01.js

This file was deleted.

13 changes: 0 additions & 13 deletions LayoutTests/dom/xhtml/level2/html/HTMLHeadElement01.xhtml

This file was deleted.

2 changes: 0 additions & 2 deletions LayoutTests/fast/dom/element-attribute-js-null-expected.txt
Expand Up @@ -72,8 +72,6 @@ TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.scroll
TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameSetElement.cols]
TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameSetElement.rows]

TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHeadElement.profile]

TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHeadingElement.align]

TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHRElement.align]
Expand Down
7 changes: 0 additions & 7 deletions LayoutTests/fast/dom/element-attribute-js-null.html
Expand Up @@ -224,13 +224,6 @@
{name: 'rows', expectedNull: 'null'}
]
},
{
type: 'HTMLHeadElement',
elementToUse: document.createElement('head'),
attributes: [
{name: 'profile', expectedNull: 'null'}
]
},
{
type: 'HTMLHeadingElement',
// no need to test h2-h6
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/html/HTMLAttributeNames.in
Expand Up @@ -367,7 +367,6 @@ poster
precision
preload
primary
profile
progress
prompt
pseudo
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/html/HTMLHeadElement.idl
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006-2022 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand All @@ -20,6 +20,5 @@
[
Exposed=Window
] interface HTMLHeadElement : HTMLElement {
[Reflect] attribute DOMString profile;
};

Expand Up @@ -156,18 +156,15 @@ gchar* webkit_dom_html_head_element_get_profile(WebKitDOMHTMLHeadElement* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(self), 0);
WebCore::HTMLHeadElement* item = WebKit::core(self);
gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::profileAttr));
return result;
return nullptr;
}

void webkit_dom_html_head_element_set_profile(WebKitDOMHTMLHeadElement* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(self));
g_return_if_fail(value);
WebCore::HTMLHeadElement* item = WebKit::core(self);
item->setAttributeWithoutSynchronization(WebCore::HTMLNames::profileAttr, WTF::AtomString::fromUTF8(value));
return;
}

G_GNUC_END_IGNORE_DEPRECATIONS;
6 changes: 3 additions & 3 deletions Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2016 Apple Inc. All rights reserved.
* Copyright (C) 2004-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -42,13 +42,13 @@ @implementation DOMHTMLHeadElement
- (NSString *)profile
{
WebCore::JSMainThreadNullState state;
return IMPL->getAttribute(WebCore::HTMLNames::profileAttr);
return nullptr;
}

- (void)setProfile:(NSString *)newProfile
{
WebCore::JSMainThreadNullState state;
IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::profileAttr, newProfile);
return;
}

@end
Expand Down

0 comments on commit 4558ead

Please sign in to comment.