-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2011-06-09 Julien Chaffraix <[email protected]>
Reviewed by Antti Koivisto. REGRESSION(84329): Stylesheets on some pages do not load https://bugs.webkit.org/show_bug.cgi?id=61400 Adding test to cover the regression. The test actually uncovered a bug in the way we handle alternate stylesheet and thus is failing some parts. * fast/css/link-disabled-attr-expected.txt: Added. * fast/css/link-disabled-attr.html: Added. 2011-06-09 Julien Chaffraix <[email protected]> Reviewed by Antti Koivisto. REGRESSION(84329): Stylesheets on some pages do not load https://bugs.webkit.org/show_bug.cgi?id=61400 Test: fast/css/link-disabled-attr.html Fixed r84329: the change did not take into account the fact that HTMLLinkElement did already contain the disabled information and the 2 information were not linked as they should have! The new logic pushes the information to the stylesheet as this is what the spec mandates and what FF is doing. Also it keeps one bit of information (that JS enabled the stylesheet) as it is needed for the recalcStyleSelector logic. * dom/Document.cpp: (WebCore::Document::recalcStyleSelector): s/isDisabled/disabled. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::HTMLLinkElement): Removed m_disabledState, replaced by m_isEnabledViaScript. (WebCore::HTMLLinkElement::setDisabled): Updated the logic after m_disabledState removal. It also matches the spec by forwarding the disabled state to our stylesheet if we have one. (WebCore::HTMLLinkElement::parseMappedAttribute): Removed harmful handling of the disabledAttr. (WebCore::HTMLLinkElement::process): Updated after m_disabledState removal. * html/HTMLLinkElement.h: (WebCore::HTMLLinkElement::isEnabledViaScript): Ditto. (WebCore::HTMLLinkElement::isAlternate): Ditto. Canonical link: https://commits.webkit.org/77896@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
38bbf12
commit b87afca
Showing
7 changed files
with
220 additions
and
57 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,17 @@ | ||
2011-06-09 Julien Chaffraix <[email protected]> | ||
|
||
Reviewed by Antti Koivisto. | ||
|
||
REGRESSION(84329): Stylesheets on some pages do not load | ||
https://bugs.webkit.org/show_bug.cgi?id=61400 | ||
|
||
Adding test to cover the regression. The test actually uncovered | ||
a bug in the way we handle alternate stylesheet and thus is | ||
failing some parts. | ||
|
||
* fast/css/link-disabled-attr-expected.txt: Added. | ||
* fast/css/link-disabled-attr.html: Added. | ||
|
||
2011-06-09 Julien Chaffraix <[email protected]> | ||
|
||
Reviewed by Darin Adler. | ||
|
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,27 @@ | ||
Series of tests to validate behavior of getting/setting link.disabled and link.sheet.disabled. | ||
Test for bug 61400: REGRESSION(84329): Stylesheets on some pages do not load | ||
|
||
notsheet | ||
PASS link.sheet is null | ||
PASS link.disabled is false | ||
sheet | ||
PASS link.sheet is non-null. | ||
PASS link.disabled is true | ||
PASS link.sheet.disabled is true | ||
PASS getComputedStyle(console).whiteSpace is 'normal' | ||
PASS link.disabled is false | ||
PASS link.sheet.disabled is false | ||
PASS getComputedStyle(console).whiteSpace is 'pre-wrap' | ||
altsheet | ||
FAIL link.disabled should be true. Was false. | ||
PASS link.sheet is non-null. | ||
FAIL getComputedStyle(console).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). | ||
FAIL link.disabled should be true. Was false. | ||
PASS getComputedStyle(console).backgroundColor is originalBG | ||
PASS link.disabled is false | ||
FAIL getComputedStyle(console).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). | ||
PASS getComputedStyle(console).backgroundColor is originalBG | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,103 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<link id="sheet" rel="stylesheet" href="../js/resources/js-test-style.css"> | ||
<link id="notsheet" rel="author" href="mailto:[email protected]"> | ||
<link id="alt" rel="alternate stylesheet" title="altset" href="resources/green.css"> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"> | ||
Series of tests to validate behavior of getting/setting link.disabled and link.sheet.disabled.<br> | ||
Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=61400">61400</a>: REGRESSION(84329): Stylesheets on some pages do not load | ||
</p> | ||
<div id="console"></div> | ||
<script> | ||
|
||
window.jsTestIsAsync = true; | ||
|
||
function onSheetLoaded(f, elem, maxtime) { | ||
if (elem.sheet || maxtime <= 0) | ||
f(elem); | ||
else | ||
setTimeout(function () { onSheetLoaded(f, elem, maxtime - 25);}, 25); | ||
} | ||
|
||
|
||
|
||
// With a non-stylesheet <link>, 'disabled' is always false. | ||
|
||
var console = document.getElementById("console"); | ||
var originalBG = getComputedStyle(console).backgroundColor; | ||
var link; | ||
|
||
debug("notsheet"); | ||
|
||
link = document.getElementById("notsheet"); | ||
shouldBeNull("link.sheet"); | ||
link.disabled = true; | ||
shouldBeFalse("link.disabled"); | ||
|
||
|
||
// With a stylesheet <link>, 'disabled' and 'link.style.disabled' should both | ||
// work, and be consistent with each other. | ||
|
||
debug("sheet"); | ||
|
||
link = document.getElementById("sheet"); | ||
shouldBeNonNull("link.sheet"); | ||
|
||
link.sheet.disabled = true; | ||
shouldBeTrue("link.disabled"); | ||
shouldBeTrue("link.sheet.disabled"); | ||
shouldBe("getComputedStyle(console).whiteSpace", "'normal'"); | ||
|
||
link.disabled = false; | ||
shouldBeFalse("link.disabled"); | ||
shouldBeFalse("link.sheet.disabled"); | ||
shouldBe("getComputedStyle(console).whiteSpace", "'pre-wrap'"); | ||
|
||
link.sheet.disabled = false; | ||
|
||
|
||
// An alternate stylesheet defaults to disabled when its title does not | ||
// match the preferred set. | ||
|
||
debug("altsheet"); | ||
link = document.getElementById("alt"); | ||
shouldBeTrue("link.disabled"); | ||
|
||
// Toggling link.disabled activates the stylesheet. | ||
|
||
function altSheetLoaded(e) { | ||
link = e; | ||
shouldBeNonNull("link.sheet"); | ||
shouldBe("getComputedStyle(console).backgroundColor", "'rgb(0, 128, 0)'"); | ||
|
||
// Enabling a stylsheet set modifies disabled status of style sheets. | ||
|
||
document.selectedStyleSheetSet = "nosuchset"; | ||
shouldBeTrue("link.disabled"); | ||
shouldBe("getComputedStyle(console).backgroundColor", "originalBG"); | ||
|
||
document.selectedStyleSheetSet = "altset"; | ||
shouldBeFalse("link.disabled"); | ||
shouldBe("getComputedStyle(console).backgroundColor", "'rgb(0, 128, 0)'"); | ||
|
||
// Disabling a stylesheet *after* its stylesheet set has been selected | ||
// de-activates it. | ||
|
||
link.disabled = true; | ||
shouldBe("getComputedStyle(console).backgroundColor", "originalBG"); | ||
|
||
finishJSTest(); | ||
} | ||
|
||
link.disabled = false; | ||
onSheetLoaded(altSheetLoaded, link, 500); | ||
|
||
successfullyParsed = true; | ||
|
||
</script> | ||
<script src="../js/resources/js-test-post.js"></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
2011-06-09 Julien Chaffraix <[email protected]> | ||
|
||
Reviewed by Antti Koivisto. | ||
|
||
REGRESSION(84329): Stylesheets on some pages do not load | ||
https://bugs.webkit.org/show_bug.cgi?id=61400 | ||
|
||
Test: fast/css/link-disabled-attr.html | ||
|
||
Fixed r84329: the change did not take into account the fact | ||
that HTMLLinkElement did already contain the disabled information | ||
and the 2 information were not linked as they should have! | ||
|
||
The new logic pushes the information to the stylesheet as this | ||
is what the spec mandates and what FF is doing. Also it keeps | ||
one bit of information (that JS enabled the stylesheet) as it | ||
is needed for the recalcStyleSelector logic. | ||
|
||
* dom/Document.cpp: | ||
(WebCore::Document::recalcStyleSelector): s/isDisabled/disabled. | ||
|
||
* html/HTMLLinkElement.cpp: | ||
(WebCore::HTMLLinkElement::HTMLLinkElement): Removed m_disabledState, | ||
replaced by m_isEnabledViaScript. | ||
(WebCore::HTMLLinkElement::setDisabled): Updated the logic after | ||
m_disabledState removal. It also matches the spec by forwarding | ||
the disabled state to our stylesheet if we have one. | ||
(WebCore::HTMLLinkElement::parseMappedAttribute): Removed harmful | ||
handling of the disabledAttr. | ||
(WebCore::HTMLLinkElement::process): Updated after m_disabledState removal. | ||
* html/HTMLLinkElement.h: | ||
(WebCore::HTMLLinkElement::isEnabledViaScript): Ditto. | ||
(WebCore::HTMLLinkElement::isAlternate): Ditto. | ||
|
||
2011-06-09 Dan Bernstein <[email protected]> | ||
|
||
Reviewed by Darin Adler. | ||
|
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