Changeset 280479 in webkit
- Timestamp:
- Jul 30, 2021 9:41:37 AM (12 months ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/html-link-element-activation-behavior-on-element-click-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/html-link-element-activation-behavior-on-element-click.html (modified) (1 diff)
-
LayoutTests/fast/dom/html-link-element-activation-behavior-on-mouse-click-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/html-link-element-activation-behavior-on-mouse-click.html (modified) (1 diff)
-
LayoutTests/fast/dom/resources/html-link-element-activation-behavior-on-element-click-step1.html (modified) (1 diff)
-
LayoutTests/fast/dom/resources/html-link-element-activation-behavior-on-mouse-click-step1.html (modified) (1 diff)
-
LayoutTests/fast/dom/resources/html-link-element-activation-behavior-target.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLLinkElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLLinkElement.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280477 r280479 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Clicking an HTMLLinkElement should not trigger a navigation 4 https://bugs.webkit.org/show_bug.cgi?id=228618 5 6 Reviewed by Sam Weinig. 7 8 Update existing tests to reflect behavior change. I verified that the tests were failing 9 in both Firefox and Chrome prior to me updating them. 10 11 * fast/dom/html-link-element-activation-behavior-on-element-click-expected.txt: 12 * fast/dom/html-link-element-activation-behavior-on-element-click.html: 13 * fast/dom/html-link-element-activation-behavior-on-mouse-click-expected.txt: 14 * fast/dom/html-link-element-activation-behavior-on-mouse-click.html: 15 * fast/dom/resources/html-link-element-activation-behavior-on-element-click-step1.html: 16 * fast/dom/resources/html-link-element-activation-behavior-on-mouse-click-step1.html: 17 * fast/dom/resources/html-link-element-activation-behavior-target.html: 18 1 19 2021-07-30 Dean Jackson <dino@apple.com> 2 20 -
trunk/LayoutTests/fast/dom/html-link-element-activation-behavior-on-element-click-expected.txt
r174637 r280479 1 This tests html link element activation behavior on DOM click1 This tests that html link element has no activation behavior on DOM click. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/fast/dom/html-link-element-activation-behavior-on-element-click.html
r174637 r280479 8 8 <iframe id="frame" src="resources/html-link-element-activation-behavior-on-element-click-step1.html"></iframe> 9 9 <script> 10 description("This tests html link element activation behavior on DOM click");10 description("This tests that html link element has no activation behavior on DOM click."); 11 11 function start(){ 12 12 frame.postMessage("element:click", "*"); -
trunk/LayoutTests/fast/dom/html-link-element-activation-behavior-on-mouse-click-expected.txt
r174637 r280479 1 This tests html link elementactivation behavior on mouse click1 This tests that html link element has no activation behavior on mouse click 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/fast/dom/html-link-element-activation-behavior-on-mouse-click.html
r174637 r280479 8 8 <iframe id="frame" src="resources/html-link-element-activation-behavior-on-mouse-click-step1.html"></iframe> 9 9 <script> 10 description("This tests html link elementactivation behavior on mouse click");10 description("This tests that html link element has no activation behavior on mouse click"); 11 11 function start(){ 12 12 frame.postMessage("mouse:click", "*"); -
trunk/LayoutTests/fast/dom/resources/html-link-element-activation-behavior-on-element-click-step1.html
r174637 r280479 14 14 function elementClick(){ 15 15 document.getElementById("target").click(); 16 setTimeout(() => { 17 window.parent.postMessage("test:ok", "*"); 18 }, 100); 16 19 } 17 20 window.addEventListener("message", elementClick); -
trunk/LayoutTests/fast/dom/resources/html-link-element-activation-behavior-on-mouse-click-step1.html
r174637 r280479 17 17 eventSender.mouseDown(); 18 18 eventSender.mouseUp(); 19 } 19 } 20 setTimeout(() => { 21 window.parent.postMessage("test:ok", "*"); 22 }, 100); 20 23 } 21 24 window.addEventListener("message", mouseClick); -
trunk/LayoutTests/fast/dom/resources/html-link-element-activation-behavior-target.html
r174637 r280479 1 1 <head> 2 2 <script> 3 function ok(){4 window.parent.postMessage("test: ok", "*");3 function fail(){ 4 window.parent.postMessage("test:fail", "*"); 5 5 } 6 6 </script> 7 7 </head> 8 <body onload=" ok()">8 <body onload="fail()"> 9 9 <h1>target</h1> 10 10 </body> -
trunk/LayoutTests/imported/w3c/ChangeLog
r280476 r280479 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Clicking an HTMLLinkElement should not trigger a navigation 4 https://bugs.webkit.org/show_bug.cgi?id=228618 5 6 Reviewed by Sam Weinig. 7 8 Rebaseline WPT test now that more checks are passing. 9 10 * web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub-expected.txt: 11 1 12 2021-07-30 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub-expected.txt
r279427 r280479 2 2 PASS follow hyperlink <a href> 3 3 PASS follow hyperlink <area href> 4 FAIL don't follow hyperlink <link href> assert_equals: The <a> navigation should occur instead of the <link> navigation. expected "/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py" but got "/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py" 4 PASS don't follow hyperlink <link href> 5 5 PASS hyperlink auditing <a ping> 6 6 PASS hyperlink auditing <area ping> -
trunk/Source/WebCore/ChangeLog
r280477 r280479 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Clicking an HTMLLinkElement should not trigger a navigation 4 https://bugs.webkit.org/show_bug.cgi?id=228618 5 6 Reviewed by Sam Weinig. 7 8 Clicking an HTMLLinkElement should not trigger a navigation because HTMLLinkElement has no activation 9 behavior as per the HTML specification: 10 - https://html.spec.whatwg.org/multipage/semantics.html#htmllinkelement 11 12 Firefox and Chrome follow the specification here. 13 14 No new tests, updated/rebaselined existing tests. 15 16 * html/HTMLLinkElement.cpp: 17 * html/HTMLLinkElement.h: 18 1 19 2021-07-30 Dean Jackson <dino@apple.com> 2 20 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r279847 r280479 566 566 } 567 567 568 void HTMLLinkElement::defaultEventHandler(Event& event)569 {570 if (MouseEvent::canTriggerActivationBehavior(event)) {571 handleClick(event);572 return;573 }574 HTMLElement::defaultEventHandler(event);575 }576 577 void HTMLLinkElement::handleClick(Event& event)578 {579 event.setDefaultHandled();580 URL url = href();581 if (url.isNull())582 return;583 RefPtr<Frame> frame = document().frame();584 if (!frame)585 return;586 frame->loader().changeLocation(url, target(), &event, ReferrerPolicy::EmptyString, document().shouldOpenExternalURLsPolicyToPropagate());587 }588 589 568 URL HTMLLinkElement::href() const 590 569 { -
trunk/Source/WebCore/html/HTMLLinkElement.h
r279847 r280479 115 115 bool isURLAttribute(const Attribute&) const final; 116 116 117 void defaultEventHandler(Event&) final;118 void handleClick(Event&);119 120 117 HTMLLinkElement(const QualifiedName&, Document&, bool createdByParser); 121 118
Note: See TracChangeset
for help on using the changeset viewer.