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
Inspector crashes when trying to inspect a page with CSS region styling
https://bugs.webkit.org/show_bug.cgi?id=91503 Patch by Raul Hudea <rhudea@adobe.com> on 2012-07-31 Reviewed by Alexander Pavlov. Source/WebCore: Fix by making sure a CSSRuleSourceData is always created when parsing @-webkit-region rules. Test: inspector/styles/region-style-crash.html * css/CSSGrammar.y: Made ruleset called explicitly markRuleBodyStart instead of depending on updateLastSelectorLineAndPosition to call it. * css/CSSParser.cpp: (WebCore::CSSParser::updateLastSelectorLineAndPosition): markRuleBodyStart should be called via at_rule_body_start. * css/CSSPropertySourceData.h: LayoutTests: Test to make sure inspector is not crashing when having to parse @-webkit-region rules * inspector/styles/region-style-crash-expected.txt: Added. * inspector/styles/region-style-crash.html: Added. * platform/chromium/TestExpectations: Canonical link: https://commits.webkit.org/110561@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
96de427
commit c26c472
Showing
8 changed files
with
189 additions
and
7 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
101 changes: 101 additions & 0 deletions
101
LayoutTests/inspector/styles/region-style-crash-expected.txt
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,101 @@ | ||
Tests that webkit css region styling can be parsed correctly. Test passes if it doesn't crash. | ||
|
||
P color styled in region: #008000. | ||
|
||
[expanded] | ||
color: red; | ||
#p1 - #ff0000 region-style-crash.html:6 | ||
display: block; | ||
p - block user agent stylesheet | ||
|
||
[expanded] | ||
element.style { () | ||
|
||
======== Matched CSS Rules ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
[expanded] | ||
#p1 { (region-style-crash.html:6) | ||
color: red; | ||
|
||
[expanded] | ||
p { (user agent stylesheet) | ||
display: block; | ||
-webkit-margin-before: 1em; | ||
-webkit-margin-after: 1em; | ||
-webkit-margin-start: 0px; | ||
-webkit-margin-end: 0px; | ||
|
||
|
||
======== Pseudo ::first-line element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::first-letter element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::before element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::after element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::selection element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-scrollbar element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-file-upload-button element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-input-placeholder element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-slider-thumb element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-search-cancel-button element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-search-decoration element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-search-results-decoration element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
======== Pseudo ::-webkit-search-results-button element ======== | ||
[expanded] | ||
#p1 { (region-style-crash.html:8) | ||
|
||
|
||
|
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,42 @@ | ||
<html> | ||
<head> | ||
<style> | ||
#article1 { -webkit-flow-into: flow1; } | ||
#region1 { -webkit-flow-from: flow1; position: absolute; top: 10px; width: 350px; height: 25px;} | ||
#p1 { color: #ff0000; } | ||
@-webkit-region #region1 { | ||
#p1 { color: #008000; } | ||
} | ||
|
||
</style> | ||
<script src="../../http/tests/inspector/inspector-test.js"></script> | ||
<script src="../../http/tests/inspector/elements-test.js"></script> | ||
<script> | ||
|
||
function test() | ||
{ | ||
WebInspector.showPanel("elements"); | ||
InspectorTest.selectNodeAndWaitForStylesWithComputed("p1", dumpAllStyles); | ||
|
||
function dumpAllStyles() | ||
{ | ||
InspectorTest.dumpSelectedElementStyles(); | ||
InspectorTest.completeTest(); | ||
} | ||
} | ||
|
||
</script> | ||
</head> | ||
|
||
<body onload="runTest()"> | ||
<p> | ||
Tests that webkit css region styling can be parsed correctly. Test passes if it doesn't crash. | ||
</p> | ||
|
||
<div id="article1"> | ||
<p id="p1">P color styled in region: #008000.</p> | ||
</div> | ||
<div id="region1" class="regionBox"></div> | ||
|
||
</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
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