Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Parsing of <body link vlink alink> is not per spec
https://bugs.webkit.org/show_bug.cgi?id=156849 Reviewed by Darin Adler. Use the rules for parsing a legacy color value to parse link, vlink, and alink content attributes on body element: https://html.spec.whatwg.org/#rules-for-parsing-a-legacy-colour-value Based on https://crrev.com/ac6c480c0c078999a785de7ef1e10c6c0c928c75 * LayoutTests/fast/html/body-color-legacy-parsing-1-expected.html: Added. * LayoutTests/fast/html/body-color-legacy-parsing-1.html: Added. * LayoutTests/fast/html/body-color-legacy-parsing-2-expected.html: Added. * LayoutTests/fast/html/body-color-legacy-parsing-2.html: Added. * LayoutTests/fast/html/body-color-legacy-parsing-3-expected.html: Added. * LayoutTests/fast/html/body-color-legacy-parsing-3.html: Added. * LayoutTests/platform/ios/TestExpectations: * Source/WebCore/html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::parseAttribute): Fixed the bug. * Source/WebCore/html/HTMLElement.cpp: (WebCore::HTMLElement::parseLegacyColorValue): Made this a protected member function. (WebCore::HTMLElement::addHTMLColorToStyle): * Source/WebCore/html/HTMLElement.h: Canonical link: https://commits.webkit.org/252992@main
- Loading branch information
Showing
10 changed files
with
70 additions
and
17 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
LayoutTests/fast/html/body-color-legacy-parsing-1-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body bgcolor="00ff00" link="#008000"> | ||
<a href="#unVisitedLink">hello</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body bgcolor="00ff0x" link="00800x"> | ||
<a href="#unVisitedLink">hello</a> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
LayoutTests/fast/html/body-color-legacy-parsing-2-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body link="#008000"> | ||
<a href="#">hello</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body alink="0080x"> | ||
<a href="#foo">hello</a> | ||
<script src="../../resources/ui-helper.js"></script> | ||
<script> | ||
(function () { | ||
if (!window.eventSender) | ||
return; | ||
const anchor = document.querySelector('a'); | ||
eventSender.mouseMoveTo(anchor.offsetLeft + anchor.offsetWidth / 2, anchor.offsetTop + anchor.offsetHeight / 2); | ||
eventSender.mouseDown(); | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
LayoutTests/fast/html/body-color-legacy-parsing-3-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body link="#008000"> | ||
<a href="#">hello</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body vlink="0080x"> | ||
<a href="#bar">hello</a> | ||
<script> | ||
if (window.testRunner) | ||
window.testRunner.keepWebHistory(); | ||
if (location.hash != '#bar') | ||
location.href = '#bar'; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters