8000 Remove HTMLFrameElement.location · WebKit/WebKit@9721073 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9721073

Browse files
Ahmad-S792Ahmad Saleem
authored andcommitted
Remove HTMLFrameElement.location
Remove HTMLFrameElement.location https://bugs.webkit.org/show_bug.cgi?id=250592 Reviewed by Ryosuke Niwa. This patch is to align WebKit with Gecko / Firefox and Blink / Chrome by removing non-standard attribute. This patch removes 'location' attribute from HTMLFrameElement, which was non-standard and WebKit only. This was never supported by Gecko and Internet Explorer. It was removed by Blink in 2014 as well. * Source/WebCore/html/HTMLFrameElementBase.cpp: (HTMLFrameElementBase::location): Removed * Source/WebCore/html/HTMLFrameElementBase.h: Remove 'location' and move 'setLocation' to 'protected' * Sourfce/WebCore/html/HTMLFrameElement.idl: Remove 'location' * Source/WebCore/page/PageColorSampler.cpp: (isValidSampleLocation): Remove "location" reference * Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm: Return nullptr for 'location' and early return for "setLocation" * LayoutTests/http/tests/secur…/javascriptURL-execution-context-frame-location-htmldom.html: Removed * LayoutTests/http/tests/secur…/javascriptURL-execution-context-frame-location-htmldom-expected.txt: Removed * LayoutTests/platform/win/TestExpectations: Remove expectation of removed test case Canonical link: https://commits.webkit.org/259067@main
1 parent f554fc0 commit 9721073

File tree

8 files changed

+6
-78
lines changed

8 files changed

+6
-78
lines changed

LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

LayoutTests/platform/win/TestExpectations

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2007-2021 Apple Inc. All rights reserved.
2+
# Copyright (C) 2007-2023 Apple Inc. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -2741,7 +2741,6 @@ http/tests/IndexedDB/storage-limit-2.https.html [ Skip ]
27412741

27422742
# Assertion failures: Not investigated
27432743
[ Debug ] http/tests/security/isolatedWorld/storage-properties.html [ Skip ]
2744-
[ Debug ] http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html [ Skip ]
27452744
[ Debug ] http/tests/security/listener/xss-window-onclick-shortcut.html [ Skip ]
27462745
[ Debug ] http/tests/local/file-url-sent-as-referer.html [ Skip ]
27472746

Source/WebCore/html/HTMLFrameElement.idl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,4 @@
3636
[CEReactions=NotNeeded, Reflect] attribute [LegacyNullToEmptyString] DOMString marginWidth;
3737

3838
[CheckSecurityForNode] Document getSVGDocument();
39-
40-
// FIXME: No other browser has this attribute.
41-
[SetterCallWith=CurrentGlobalObject] attribute DOMString? location;
4239
};

Source/WebCore/html/HTMLFrameElementBase.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,6 @@ void HTMLFrameElementBase::didAttachRenderers()
166166
}
167167
}
168168

169-
URL HTMLFrameElementBase::location() const
170-
{
171-
if (hasAttributeWithoutSynchronization(srcdocAttr))
172-
return aboutSrcDocURL();
173-
return document().completeURL(attributeWithoutSynchronization(srcAttr));
174-
}
175-
176169
void HTMLFrameElementBase::setLocation(const String& str)
177170
{
178171
if (document().settings().needsAcrobatFrameReloadingQuirk() && m_frameURL == str)

Source/WebCore/html/HTMLFrameElementBase.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ namespace WebCore {
3535
class HTMLFrameElementBase : public HTMLFrameOwnerElement {
3636
WTF_MAKE_ISO_ALLOCATED(HTMLFrameElementBase);
3737
public:
38-
WEBCORE_EXPORT URL location() const;
39-
WEBCORE_EXPORT void setLocation(const String&);
4038
void setLocation(JSC::JSGlobalObject&, const String&);
4139

4240
ScrollbarMode scrollingMode() const final;
@@ -51,6 +49,7 @@ class HTMLFrameElementBase : public HTMLFrameOwnerElement {
5149
void didFinishInsertingNode() final;
5250
void didAttachRenderers() override;
5351

52+
WEBCORE_EXPORT void setLocation(const String&);
5453
void openURL(LockHistory = LockHistory::Yes, LockBackForwardList = LockBackForwardList::Yes);
5554

5655
AtomString frameURL() const { return m_frameURL; }

Source/WebCore/page/PageColorSampler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Apple Inc. All rights reserved.
2+
* Copyright (C) 2021-2023 Apple Inc. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -100,7 +100,7 @@ static bool isValidSampleLocation(Document& document, const IntPoint& location)
100100
return false;
101101

102102
// Skip 3rd-party `<iframe>` as the content likely won't match the rest of the page.
103-
if (is<HTMLIFrameElement>(element) && !areRegistrableDomainsEqual(downcast<HTMLIFrameElement>(element).location(), document.url()))
103+
if (is<HTMLIFrameElement>(element))
104104
return false;
105105
}
106106

Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,12 @@ - (DOMAbstractView *)contentWindow
153153

154154
- (NSString *)location
155155
{
156-
WebCore::JSMainThreadNullState state;
157-
return IMPL->location().string();
156+
return nullptr;
158157
}
159158

160159
- (void)setLocation:(NSString *)newLocation
161160
{
162-
WebCore::JSMainThreadNullState state;
163-
IMPL->setLocation(newLocation);
161+
return;
164162
}
165163

166164
@end

0 commit comments

Comments
 (0)
0