Diff
Modified: trunk/LayoutTests/ChangeLog (119228 => 119229)
--- trunk/LayoutTests/ChangeLog 2012-06-01 14:23:01 UTC (rev 119228)
+++ trunk/LayoutTests/ChangeLog 2012-06-01 14:27:37 UTC (rev 119229)
@@ -1,3 +1,14 @@
+2012-06-01 Alexander Pavlov <[email protected]>
+
+ Web Inspector: Prepare styles-new-API.html results format for a more complex CSS model
+ https://bugs.webkit.org/show_bug.cgi?id=88090
+
+ Reviewed by Antti Koivisto.
+
+ * inspector/styles/resources/styles-new-API.css:
+ * inspector/styles/styles-new-API-expected.txt:
+ * inspector/styles/styles-new-API.html:
+
2012-06-01 Christophe Dumez <[email protected]>
[EFL] [DRT] editing/execCommand/paste-and-match-style-event.html crashes
Modified: trunk/LayoutTests/inspector/styles/resources/styles-new-API.css (119228 => 119229)
--- trunk/LayoutTests/inspector/styles/resources/styles-new-API.css 2012-06-01 14:23:01 UTC (rev 119228)
+++ trunk/LayoutTests/inspector/styles/resources/styles-new-API.css 2012-06-01 14:27:37 UTC (rev 119229)
@@ -1,3 +1,5 @@
+@charset "UTF-8";
+
@import url("styles-new-API-1.css");
html {
Modified: trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt (119228 => 119229)
--- trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt 2012-06-01 14:23:01 UTC (rev 119228)
+++ trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt 2012-06-01 14:27:37 UTC (rev 119229)
@@ -7,100 +7,86 @@
OK
=== Matched rules for body ===
+body: [user-agent] {
+ ['display':'block'] @[undefined-undefined] style
+ ['margin-top':'8px'] @[undefined-undefined] style
+ ['margin-right':'8px'] @[undefined-undefined] style
+ ['margin-bottom':'8px'] @[undefined-undefined] style
+ ['margin-left':'8px'] @[undefined-undefined] style
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
+body: [regular] {
+ ['font-size':'12px'] @[5-21] active
+ ['foo':'bar !
-rule
-body: [user-agent]
-['display':'block'] @[undefined-undefined] style
-['margin-top':'8px'] @[undefined-undefined] style
-['margin-right':'8px'] @[undefined-undefined] style
-['margin-bottom':'8px'] @[undefined-undefined] style
-['margin-left':'8px'] @[undefined-undefined] style
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
-rule
-body: [regular]
-['font-size':'12px'] @[5-21] active
-['foo':'bar !
-
important /* !important property not recognized by WebCore */' is-important non-parsed] @[26-104] active
-['height':'100% !important' is-important] @[109-133] active
-['colorz':'"!important"' non-parsed] @[138-159] active
-['important':'!important' non-parsed] @[164-185] active
-['color':'yellow'] @[190-204] active
-['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+ ['height':'100% !important' is-important] @[109-133] active
+ ['colorz':'"!important"' non-parsed] @[138-159] active
+ ['important':'!important' non-parsed] @[164-185] active
+ ['color':'yellow'] @[190-204] active
+ ['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+}
+body.main1: [regular] {
+ ['color':'#F00BAA'] @[13-28] active
+ ['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
+}
+body.main2: [regular] {
+ ['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
+ ['background-image':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-x':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-y':'initial' is-important] @[undefined-undefined] style
+ ['background-attachment':'initial' is-important] @[undefined-undefined] style
+ ['background-position-x':'initial' is-important] @[undefined-undefined] style
+ ['background-position-y':'initial' is-important] @[undefined-undefined] style
+ ['background-origin':'initial' is-important] @[undefined-undefined] style
+ ['background-clip':'initial' is-important] @[undefined-undefined] style
+ ['background-color':'green' is-important] @[undefined-undefined] style
+ ['background-size':'initial' is-important] @[undefined-undefined] style
+}
+body.mainpage: [regular] {
+ ['text-decoration':'none'] @[5-27] active
+ ['badproperty':'1badvalue1' non-parsed] @[108-132] active
+}
+body.mainpage: [regular] {
+ ['prop1':'val1' non-parsed] @[5-17] active
+ ['prop2':'val2' non-parsed] @[22-34] active
+}
-rule
-body.main1: [regular]
-['color':'#F00BAA'] @[13-28] active
-['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
-
-rule
-body.main2: [regular]
-['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
-['background-image':'initial' is-important] @[undefined-undefined] style
-['background-repeat-x':'initial' is-important] @[undefined-undefined] style
-['background-repeat-y':'initial' is-important] @[undefined-undefined] style
-['background-attachment':'initial' is-important] @[undefined-undefined] style
-['background-position-x':'initial' is-important] @[undefined-undefined] style
-['background-position-y':'initial' is-important] @[undefined-undefined] style
-['background-origin':'initial' is-important] @[undefined-undefined] style
-['background-clip':'initial' is-important] @[undefined-undefined] style
-['background-color':'green' is-important] @[undefined-undefined] style
-['background-size':'initial' is-important] @[undefined-undefined] style
-
-rule
-body.mainpage: [regular]
-['text-decoration':'none'] @[5-27] active
-['badproperty':'1badvalue1' non-parsed] @[108-132] active
-
-rule
-body.mainpage: [regular]
-['prop1':'val1' non-parsed] @[5-17] active
-['prop2':'val2' non-parsed] @[22-34] active
-
=== Pseudo rules for body ===
PseudoId=4
+body::after: [regular] {
+ ['content':'"After body"'] @[5-27] active
+}
-rule
-body::after: [regular]
-['content':'"After body"'] @[5-27] active
-
=== Inherited styles for body ===
Level=1
+[NO STYLE]
+html: [user-agent] {
+ ['display':'block'] @[undefined-undefined] style
+}
+html: [regular] {
+ ['font-weight':'400'] @[5-22] active
+}
-rule
-html: [user-agent]
-['display':'block'] @[undefined-undefined] style
-
-rule
-html: [regular]
-['font-weight':'400'] @[5-22] active
-
=== Inline style for body ===
-
-style
-raw style
['font-weight':'normal'] @[0-20] active
['width':'85%'] @[21-32] active
['background-image':'url(bar.png)'] @[33-63] active
=== Attributes style for table ===
-
-style
-raw style
['width':'50%'] @[undefined-undefined] style
=== All stylesheets ===
-StyleSheet: '@import url("styles-new-API-1.css");
+StyleSheet: '@charset "UTF-8";
+@import url("styles-new-API-1.css");
+
html {
font-weight: 400;
}
@@ -131,70 +117,64 @@
height : 100% ; border: 1px solid; border-width: 2px; background-color : #33FF33; googles: abra; foo: .bar; -moz-goog: 1***; border-width: 0px;
}
'
+html: [regular] {
+ ['font-weight':'400'] @[5-22] active
+}
+body: [regular] {
+ ['font-size':'12px'] @[5-21] active
+ ['foo':'bar !
-rule
-html: [regular]
-['font-weight':'400'] @[5-22] active
-
-rule
-body: [regular]
-['font-size':'12px'] @[5-21] active
-['foo':'bar !
-
important /* !important property not recognized by WebCore */' is-important non-parsed] @[26-104] active
-['height':'100% !important' is-important] @[109-133] active
-['colorz':'"!important"' non-parsed] @[138-159] active
-['important':'!important' non-parsed] @[164-185] active
-['color':'yellow'] @[190-204] active
-['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+ ['height':'100% !important' is-important] @[109-133] active
+ ['colorz':'"!important"' non-parsed] @[138-159] active
+ ['important':'!important' non-parsed] @[164-185] active
+ ['color':'yellow'] @[190-204] active
+ ['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+}
+body.main1: [regular] {
+ ['color':'#F00BAA'] @[13-28] active
+ ['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
+}
+body.main2: [regular] {
+ ['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
+ ['background-image':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-x':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-y':'initial' is-important] @[undefined-undefined] style
+ ['background-attachment':'initial' is-important] @[undefined-undefined] style
+ ['background-position-x':'initial' is-important] @[undefined-undefined] style
+ ['background-position-y':'initial' is-important] @[undefined-undefined] style
+ ['background-origin':'initial' is-important] @[undefined-undefined] style
+ ['background-clip':'initial' is-important] @[undefined-undefined] style
+ ['background-color':'green' is-important] @[undefined-undefined] style
+ ['background-size':'initial' is-important] @[undefined-undefined] style
+}
+body::after: [regular] {
+ ['content':'"After body"'] @[5-27] active
+}
+h1: [regular] {
+ ['height':'100%'] @[5-20] active
+ ['border':'1px solid'] @[21-39] active
+ ['border-width':'2px'] @[40-58] inactive
+ ['background-color':'#33FF33'] @[59-86] active
+ ['googles':'abra' non-parsed] @[87-101] active
+ ['foo':'.bar' non-parsed] @[102-112] active
+ ['-moz-goog':'1***' non-parsed] @[113-129] active
+ ['border-width':'0px'] @[130-148] active
+ ['border-top-style':'solid'] @[undefined-undefined] style
+ ['border-right-style':'solid'] @[undefined-undefined] style
+ ['border-bottom-style':'solid'] @[undefined-undefined] style
+ ['border-left-style':'solid'] @[undefined-undefined] style
+ ['border-top-color':'initial'] @[undefined-undefined] style
+ ['border-right-color':'initial'] @[undefined-undefined] style
+ ['border-bottom-color':'initial'] @[undefined-undefined] style
+ ['border-left-color':'initial'] @[undefined-undefined] style
+ ['border-image':'initial'] @[undefined-undefined] style
+ ['border-top-width':'0px'] @[undefined-undefined] style
+ ['border-right-width':'0px'] @[undefined-undefined] style
+ ['border-bottom-width':'0px'] @[undefined-undefined] style
+ ['border-left-width':'0px'] @[undefined-undefined] style
+}
-rule
-body.main1: [regular]
-['color':'#F00BAA'] @[13-28] active
-['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
-
-rule
-body.main2: [regular]
-['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
-['background-image':'initial' is-important] @[undefined-undefined] style
-['background-repeat-x':'initial' is-important] @[undefined-undefined] style
-['background-repeat-y':'initial' is-important] @[undefined-undefined] style
-['background-attachment':'initial' is-important] @[undefined-undefined] style
-['background-position-x':'initial' is-important] @[undefined-undefined] style
-['background-position-y':'initial' is-important] @[undefined-undefined] style
-['background-origin':'initial' is-important] @[undefined-undefined] style
-['background-clip':'initial' is-important] @[undefined-undefined] style
-['background-color':'green' is-important] @[undefined-undefined] style
-['background-size':'initial' is-important] @[undefined-undefined] style
-
-rule
-body::after: [regular]
-['content':'"After body"'] @[5-27] active
-
-rule
-h1: [regular]
-['height':'100%'] @[5-20] active
-['border':'1px solid'] @[21-39] active
-['border-width':'2px'] @[40-58] inactive
-['background-color':'#33FF33'] @[59-86] active
-['googles':'abra' non-parsed] @[87-101] active
-['foo':'.bar' non-parsed] @[102-112] active
-['-moz-goog':'1***' non-parsed] @[113-129] active
-['border-width':'0px'] @[130-148] active
-['border-top-style':'solid'] @[undefined-undefined] style
-['border-right-style':'solid'] @[undefined-undefined] style
-['border-bottom-style':'solid'] @[undefined-undefined] style
-['border-left-style':'solid'] @[undefined-undefined] style
-['border-top-color':'initial'] @[undefined-undefined] style
-['border-right-color':'initial'] @[undefined-undefined] style
-['border-bottom-color':'initial'] @[undefined-undefined] style
-['border-left-color':'initial'] @[undefined-undefined] style
-['border-image':'initial'] @[undefined-undefined] style
-['border-top-width':'0px'] @[undefined-undefined] style
-['border-right-width':'0px'] @[undefined-undefined] style
-['border-bottom-width':'0px'] @[undefined-undefined] style
-['border-left-width':'0px'] @[undefined-undefined] style
-
StyleSheet: '@import url(styles-new-API-2.css);
@page { margin: 2cm } /* All margins set to 2cm */
@@ -221,14 +201,12 @@
}
'
+#absent-id: [regular] {
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
-rule
-#absent-id: [regular]
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
StyleSheet: '@import url(styles-new-API-1.css);
@page { margin: 2cm } /* All margins set to 2cm */
@@ -255,14 +233,12 @@
}
'
+#absent-id: [regular] {
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
-rule
-#absent-id: [regular]
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
StyleSheet: '
/* An inline stylesheet */
@@ -277,144 +253,124 @@
}
'
+body.mainpage: [regular] {
+ ['text-decoration':'none'] @[5-27] active
+ ['badproperty':'1badvalue1' non-parsed] @[108-132] active
+}
+body.mainpage: [regular] {
+ ['prop1':'val1' non-parsed] @[5-17] active
+ ['prop2':'val2' non-parsed] @[22-34] active
+}
-rule
-body.mainpage: [regular]
-['text-decoration':'none'] @[5-27] active
-['badproperty':'1badvalue1' non-parsed] @[108-132] active
-
-rule
-body.mainpage: [regular]
-['prop1':'val1' non-parsed] @[5-17] active
-['prop2':'val2' non-parsed] @[22-34] active
-
=== Last stylesheet patched ===
StyleSheet: 'body.mainpage { text-decoration: strikethrough; badproperty: 2badvalue2;}body { text-align: justify;}'
+body.mainpage: [regular] {
+ ['text-decoration':'strikethrough' non-parsed] @[4-35] active
+ ['badproperty':'2badvalue2' non-parsed] @[39-63] active
+}
+body: [regular] {
+ ['text-align':'justify'] @[4-24] active
+}
-rule
-body.mainpage: [regular]
-['text-decoration':'strikethrough' non-parsed] @[4-35] active
-['badproperty':'2badvalue2' non-parsed] @[39-63] active
-
-rule
-body: [regular]
-['text-align':'justify'] @[4-24] active
-
=== After selector set ===
StyleSheet: 'html *, body[foo="bar"] { text-decoration: strikethrough; badproperty: 2badvalue2;}body { text-align: justify;}'
+html *, body[foo="bar"]: [regular] {
+ ['text-decoration':'strikethrough' non-parsed] @[4-35] active
+ ['badproperty':'2badvalue2' non-parsed] @[39-63] active
+}
+body: [regular] {
+ ['text-align':'justify'] @[4-24] active
+}
-rule
-html *, body[foo="bar"]: [regular]
-['text-decoration':'strikethrough' non-parsed] @[4-35] active
-['badproperty':'2badvalue2' non-parsed] @[39-63] active
-
-rule
-body: [regular]
-['text-align':'justify'] @[4-24] active
-
=== After style text set ===
StyleSheet: 'html *, body[foo="bar"] {
color: white; background: black;
}body { text-align: justify;}'
+html *, body[foo="bar"]: [regular] {
+ ['color':'white'] @[5-18] active
+ ['background':'black'] @[19-37] active
+ ['background-image':'initial'] @[undefined-undefined] style
+ ['background-repeat-x':'initial'] @[undefined-undefined] style
+ ['background-repeat-y':'initial'] @[undefined-undefined] style
+ ['background-attachment':'initial'] @[undefined-undefined] style
+ ['background-position-x':'initial'] @[undefined-undefined] style
+ ['background-position-y':'initial'] @[undefined-undefined] style
+ ['background-origin':'initial'] @[undefined-undefined] style
+ ['background-clip':'initial'] @[undefined-undefined] style
+ ['background-color':'black'] @[undefined-undefined] style
+ ['background-size':'initial'] @[undefined-undefined] style
+}
+body: [regular] {
+ ['text-align':'justify'] @[4-24] active
+}
-rule
-html *, body[foo="bar"]: [regular]
-['color':'white'] @[5-18] active
-['background':'black'] @[19-37] active
-['background-image':'initial'] @[undefined-undefined] style
-['background-repeat-x':'initial'] @[undefined-undefined] style
-['background-repeat-y':'initial'] @[undefined-undefined] style
-['background-attachment':'initial'] @[undefined-undefined] style
-['background-position-x':'initial'] @[undefined-undefined] style
-['background-position-y':'initial'] @[undefined-undefined] style
-['background-origin':'initial'] @[undefined-undefined] style
-['background-clip':'initial'] @[undefined-undefined] style
-['background-color':'black'] @[undefined-undefined] style
-['background-size':'initial'] @[undefined-undefined] style
-
-rule
-body: [regular]
-['text-align':'justify'] @[4-24] active
-
=== Matched rules after rule added ===
+body: [user-agent] {
+ ['display':'block'] @[undefined-undefined] style
+ ['margin-top':'8px'] @[undefined-undefined] style
+ ['margin-right':'8px'] @[undefined-undefined] style
+ ['margin-bottom':'8px'] @[undefined-undefined] style
+ ['margin-left':'8px'] @[undefined-undefined] style
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
+body: [regular] {
+ ['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
+}
+body: [regular] {
+ ['font-size':'12px'] @[5-21] active
+ ['foo':'bar !
-rule
-body: [user-agent]
-['display':'block'] @[undefined-undefined] style
-['margin-top':'8px'] @[undefined-undefined] style
-['margin-right':'8px'] @[undefined-undefined] style
-['margin-bottom':'8px'] @[undefined-undefined] style
-['margin-left':'8px'] @[undefined-undefined] style
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
-rule
-body: [regular]
-['property':'imported-media-screen-stylesheet' non-parsed] @[5-48] active
-
-rule
-body: [regular]
-['font-size':'12px'] @[5-21] active
-['foo':'bar !
-
important /* !important property not recognized by WebCore */' is-important non-parsed] @[26-104] active
-['height':'100% !important' is-important] @[109-133] active
-['colorz':'"!important"' non-parsed] @[138-159] active
-['important':'!important' non-parsed] @[164-185] active
-['color':'yellow'] @[190-204] active
-['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+ ['height':'100% !important' is-important] @[109-133] active
+ ['colorz':'"!important"' non-parsed] @[138-159] active
+ ['important':'!important' non-parsed] @[164-185] active
+ ['color':'yellow'] @[190-204] active
+ ['color':'"badcolor" ! important /* good property with strange value */' is-important non-parsed] @[209-278] active
+}
+html *, body[foo="bar"]: [regular] {
+ ['color':'white'] @[5-18] active
+ ['background':'black'] @[19-37] active
+ ['background-image':'initial'] @[undefined-undefined] style
+ ['background-repeat-x':'initial'] @[undefined-undefined] style
+ ['background-repeat-y':'initial'] @[undefined-undefined] style
+ ['background-attachment':'initial'] @[undefined-undefined] style
+ ['background-position-x':'initial'] @[undefined-undefined] style
+ ['background-position-y':'initial'] @[undefined-undefined] style
+ ['background-origin':'initial'] @[undefined-undefined] style
+ ['background-clip':'initial'] @[undefined-undefined] style
+ ['background-color':'black'] @[undefined-undefined] style
+ ['background-size':'initial'] @[undefined-undefined] style
+}
+body: [regular] {
+ ['text-align':'justify'] @[4-24] active
+}
+body: [inspector] {
+ ['font-family':'serif'] @[5-24] active
+}
+body.main1: [regular] {
+ ['color':'#F00BAA'] @[13-28] active
+ ['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
+}
+body.main2: [regular] {
+ ['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
+ ['background-image':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-x':'initial' is-important] @[undefined-undefined] style
+ ['background-repeat-y':'initial' is-important] @[undefined-undefined] style
+ ['background-attachment':'initial' is-important] @[undefined-undefined] style
+ ['background-position-x':'initial' is-important] @[undefined-undefined] style
+ ['background-position-y':'initial' is-important] @[undefined-undefined] style
+ ['background-origin':'initial' is-important] @[undefined-undefined] style
+ ['background-clip':'initial' is-important] @[undefined-undefined] style
+ ['background-color':'green' is-important] @[undefined-undefined] style
+ ['background-size':'initial' is-important] @[undefined-undefined] style
+}
-rule
-html *, body[foo="bar"]: [regular]
-['color':'white'] @[5-18] active
-['background':'black'] @[19-37] active
-['background-image':'initial'] @[undefined-undefined] style
-['background-repeat-x':'initial'] @[undefined-undefined] style
-['background-repeat-y':'initial'] @[undefined-undefined] style
-['background-attachment':'initial'] @[undefined-undefined] style
-['background-position-x':'initial'] @[undefined-undefined] style
-['background-position-y':'initial'] @[undefined-undefined] style
-['background-origin':'initial'] @[undefined-undefined] style
-['background-clip':'initial'] @[undefined-undefined] style
-['background-color':'black'] @[undefined-undefined] style
-['background-size':'initial'] @[undefined-undefined] style
-
-rule
-body: [regular]
-['text-align':'justify'] @[4-24] active
-
-rule
-body: [inspector]
-['font-family':'serif'] @[5-24] active
-
-rule
-body.main1: [regular]
-['color':'#F00BAA'] @[13-28] active
-['zoo':'moo /* not an !important unrecognized property */' non-parsed] @[28-81] active
-
-rule
-body.main2: [regular]
-['background':'green /* value !important comment */ !important /* no semicolon, very !important */' is-important] @[0-95] active
-['background-image':'initial' is-important] @[undefined-undefined] style
-['background-repeat-x':'initial' is-important] @[undefined-undefined] style
-['background-repeat-y':'initial' is-important] @[undefined-undefined] style
-['background-attachment':'initial' is-important] @[undefined-undefined] style
-['background-position-x':'initial' is-important] @[undefined-undefined] style
-['background-position-y':'initial' is-important] @[undefined-undefined] style
-['background-origin':'initial' is-important] @[undefined-undefined] style
-['background-clip':'initial' is-important] @[undefined-undefined] style
-['background-color':'green' is-important] @[undefined-undefined] style
-['background-size':'initial' is-important] @[undefined-undefined] style
-
=== After property manipulations ===
-
-style
-raw style
[text='height : 100% ;'] disabled
['border':'1px solid'] @[1-19] active
['border-width':'2px'] @[20-38] inactive
@@ -439,9 +395,6 @@
['border-image':'initial'] @[undefined-undefined] style
=== After property enabled ===
-
-style
-raw style
[text='height : 100% ;'] disabled
['border':'1px solid'] @[1-19] active
['border-width':'2px'] @[20-38] inactive
Modified: trunk/LayoutTests/inspector/styles/styles-new-API.html (119228 => 119229)
--- trunk/LayoutTests/inspector/styles/styles-new-API.html 2012-06-01 14:23:01 UTC (rev 119228)
+++ trunk/LayoutTests/inspector/styles/styles-new-API.html 2012-06-01 14:27:37 UTC (rev 119229)
@@ -38,13 +38,13 @@
InspectorTest.addResult("=== Inherited styles for body ===");
for (var i = 0; i < styles.inherited.length; ++i) {
InspectorTest.addResult("Level=" + (i + 1));
- dumpRuleOrStyle(styles.inherited[i].inlineStyle);
+ dumpStyle(styles.inherited[i].inlineStyle);
dumpRulesArray(styles.inherited[i].matchedCSSRules);
}
InspectorTest.addResult("");
InspectorTest.addResult("=== Inline style for body ===");
- dumpRuleOrStyle(styles.inlineStyle);
+ dumpStyle(styles.inlineStyle);
test_tableStyles();
}
@@ -104,7 +104,7 @@
}
InspectorTest.addResult("");
InspectorTest.addResult("=== Attributes style for table ===");
- dumpRuleOrStyle(attributesStyle);
+ dumpStyle(attributesStyle);
test_styleSheets();
}
@@ -230,7 +230,7 @@
}
InspectorTest.addResult("");
InspectorTest.addResult("=== After property manipulations ===");
- dumpRuleOrStyle(style);
+ dumpStyle(style);
test_enableProperty(style.styleId);
}
@@ -288,7 +288,7 @@
}
InspectorTest.addResult("");
InspectorTest.addResult("=== After property enabled ===");
- dumpRuleOrStyle(style);
+ dumpStyle(style);
InspectorTest.completeTest();
}
@@ -298,33 +298,74 @@
// Data dumping
- function dumpRulesArray(rules)
+ const indent = " ";
+
+ function dumpRulesArray(rules, currentIndent)
{
+ currentIndent = currentIndent || "";
if (!rules)
return;
for (var i = 0; i < rules.length; ++i)
- dumpRuleOrStyle(rules[i]);
+ dumpRule(rules[i], currentIndent);
}
- function dumpRuleOrStyle(ruleOrStyle)
+ function dumpRule(rule, currentIndent)
{
- if (!ruleOrStyle)
+ currentIndent = currentIndent || "";
+
+ if (!rule.type || rule.type === "style") {
+ InspectorTest.addResult(currentIndent + rule.selectorText + ": [" + rule.origin + "] {");
+ dumpStyle(rule.style, currentIndent + indent);
+ InspectorTest.addResult(currentIndent + "}");
return;
- var isRule = !!(ruleOrStyle.style);
- var style = isRule ? ruleOrStyle.style : ruleOrStyle;
- InspectorTest.addResult("");
- InspectorTest.addResult(isRule ? "rule" : "style");
- InspectorTest.addResult((isRule ? (ruleOrStyle.selectorText + ": [" + ruleOrStyle.origin + "]") : "raw style"));
+ }
+
+ if (rule.type === "media") {
+ InspectorTest.addResult(currentIndent + "@media " + rule.mediaText + " {");
+ dumpRulesArray(rule.childRules, currentIndent + indent);
+ InspectorTest.addResult(currentIndent + "}");
+ return;
+ }
+
+ if (rule.type === "import") {
+ InspectorTest.addResult(currentIndent + "@import: header=" + InspectorTest.rangeText(rule.headerRange) + ", body=" + InspectorTest.rangeText(rule.bodyRange));
+ return;
+ }
+
+ if (rule.type === "page" || rule.type === "font-face") {
+ if (rule.type === "page")
+ InspectorTest.addResult(currentIndent + rule.selectorText + " {");
+ else
+ InspectorTest.addResult(currentIndent + "@" + rule.type + " " + (rule.selectorText ? rule.selectorText + " " : "") + "{");
+ dumpStyle(rule.style, currentIndent + indent);
+ InspectorTest.addResult(currentIndent + "}");
+ return;
+ }
+
+ if (rule.type === "charset") {
+ InspectorTest.addResult("@charset");
+ return;
+ }
+
+ InspectorTest.addResult(currentIndent + "[UNKNOWN RULE]: header=" + InspectorTest.rangeText(rule.headerRange) + ", body=" + InspectorTest.rangeText(rule.bodyRange));
+ }
+
+ function dumpStyle(style, currentIndent)
+ {
+ currentIndent = currentIndent || "";
+ if (!style) {
+ InspectorTest.addResult(currentIndent + "[NO STYLE]");
+ return;
+ }
for (var i = 0; i < style.cssProperties.length; ++i) {
var property = style.cssProperties[i];
if (property.status !== "disabled")
- InspectorTest.addResult("['" + property.name + "':'" + property.value + "'" + (property.priority === "important" ? " is-important" : "") + (("parsedOk" in property) ? " non-parsed" : "") +"] @" + InspectorTest.rangeText(property.range) + " " + (property.status || "style"));
+ InspectorTest.addResult(currentIndent + "['" + property.name + "':'" + property.value + "'" + (property.priority === "important" ? " is-important" : "") + (("parsedOk" in property) ? " non-parsed" : "") +"] @" + InspectorTest.rangeText(property.range) + " " + (property.status || "style"));
else
- InspectorTest.addResult("[text='" + property.text + "'] " + property.status);
+ InspectorTest.addResult(currentIndent + "[text='" + property.text + "'] " + property.status);
}
}
-
function loadAndDumpStyleSheet(styleSheetId, continuation, error)
{
if (error) {
@@ -340,8 +381,7 @@
}
InspectorTest.addResult("");
InspectorTest.addResult("StyleSheet: '" + styleSheet.text + "'");
- for (var i = 0; i < styleSheet.rules.length; ++i)
- dumpRuleOrStyle(styleSheet.rules[i]);
+ dumpRulesArray(styleSheet.rules);
if (continuation)
continuation(styleSheet);
}