[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
apavlov at chromium.org
apavlov at chromium.org
Wed Dec 22 15:58:03 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c3e0155313a6f2784f4920ef8c3a023b6951cadf
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 17 10:48:08 2010 +0000
2010-11-17 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: [REGRESSION] editing disabled styles breaks style bodies.
https://bugs.webkit.org/show_bug.cgi?id=49602
* inspector/styles-new-API-expected.txt:
* inspector/styles-new-API.html:
2010-11-17 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: [REGRESSION] editing disabled styles breaks style bodies.
https://bugs.webkit.org/show_bug.cgi?id=49602
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::setPropertyText):
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertyTreeElement.prototype.get name):
(WebInspector.StylePropertyTreeElement.prototype.get priority):
(WebInspector.StylePropertyTreeElement.prototype.get value):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d209cb8..0ae418e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-17 Alexander Pavlov <apavlov at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] editing disabled styles breaks style bodies.
+ https://bugs.webkit.org/show_bug.cgi?id=49602
+
+ * inspector/styles-new-API-expected.txt:
+ * inspector/styles-new-API.html:
+
2010-11-17 Andy Estes <aestes at apple.com>
Two more tests needing new results after r72173.
diff --git a/LayoutTests/inspector/styles-new-API-expected.txt b/LayoutTests/inspector/styles-new-API-expected.txt
index 8b6de00..b62e03e 100644
--- a/LayoutTests/inspector/styles-new-API-expected.txt
+++ b/LayoutTests/inspector/styles-new-API-expected.txt
@@ -299,22 +299,22 @@ style
raw style
[text='height : 100% ;'] disabled
['border':'1px solid'] @[6-24] active
-['border-width':'2px'] @[25-43] active
+['border-width':'2px'] @[25-43] inactive
['googles':'abra' non-parsed] @[45-59] active
['foo':'.bar' non-parsed] @[60-70] active
['-moz-goog':'1***' non-parsed] @[71-87] active
['font-size':'12px'] @[88-104] active
-[text='border-width: 0px;'] disabled
+['border-width':'1px'] @[104-122] active
[text='font-size: 14px;'] disabled
['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-color':'initial'] @[undefined-undefined] style
-['border-top-width':'2px'] @[undefined-undefined] style
-['border-right-width':'2px'] @[undefined-undefined] style
-['border-bottom-width':'2px'] @[undefined-undefined] style
-['border-left-width':'2px'] @[undefined-undefined] style
+['border-top-width':'1px'] @[undefined-undefined] style
+['border-right-width':'1px'] @[undefined-undefined] style
+['border-bottom-width':'1px'] @[undefined-undefined] style
+['border-left-width':'1px'] @[undefined-undefined] style
=== After property enabled ===
@@ -322,20 +322,20 @@ style
raw style
[text='height : 100% ;'] disabled
['border':'1px solid'] @[6-24] active
-['border-width':'2px'] @[25-43] active
+['border-width':'2px'] @[25-43] inactive
['googles':'abra' non-parsed] @[45-59] active
['foo':'.bar' non-parsed] @[60-70] active
['-moz-goog':'1***' non-parsed] @[71-87] active
['font-size':'12px'] @[88-104] inactive
-[text='border-width: 0px;'] disabled
-['font-size':'14px'] @[105-121] active
+['border-width':'1px'] @[104-122] active
+['font-size':'14px'] @[123-139] 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-color':'initial'] @[undefined-undefined] style
-['border-top-width':'2px'] @[undefined-undefined] style
-['border-right-width':'2px'] @[undefined-undefined] style
-['border-bottom-width':'2px'] @[undefined-undefined] style
-['border-left-width':'2px'] @[undefined-undefined] style
+['border-top-width':'1px'] @[undefined-undefined] style
+['border-right-width':'1px'] @[undefined-undefined] style
+['border-bottom-width':'1px'] @[undefined-undefined] style
+['border-left-width':'1px'] @[undefined-undefined] style
diff --git a/LayoutTests/inspector/styles-new-API.html b/LayoutTests/inspector/styles-new-API.html
index 9d0725b..8d6432d 100644
--- a/LayoutTests/inspector/styles-new-API.html
+++ b/LayoutTests/inspector/styles-new-API.html
@@ -188,6 +188,8 @@ function frontend_disableProperty(testController)
InspectorBackend.setPropertyText2(style.styleId, 7, "font-size: 12px;", false);
InspectorBackend.setPropertyText2(style.styleId, 9, "font-size: 14px;", false);
InspectorBackend.toggleProperty2(style.styleId, 9, true); // font-size: 14px
+ InspectorBackend.setPropertyText2(style.styleId, 8, "border-width: 1px;", true);
+ InspectorBackend.toggleProperty2(style.styleId, 8, false); // border-width: 1px
// height : 100% ; [d]
// border: 1px solid;
// border-width: 2px;
@@ -196,7 +198,7 @@ function frontend_disableProperty(testController)
// foo: .bar;
// -moz-goog: 1***;
// font-size: 12px;
- // border-width: 0px; [d]
+ // border-width: 1px;
// font-size: 14px; [d]
InspectorBackend.setPropertyText2(style.styleId, 3, "", true, didDisableProperty.bind(null, testController));
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5830a5c..90add47 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-17 Alexander Pavlov <apavlov at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] editing disabled styles breaks style bodies.
+ https://bugs.webkit.org/show_bug.cgi?id=49602
+
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::setPropertyText):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.get name):
+ (WebInspector.StylePropertyTreeElement.prototype.get priority):
+ (WebInspector.StylePropertyTreeElement.prototype.get value):
+
2010-11-16 Adam Roben <aroben at apple.com>
Move QTMovieWin's settings into a vsprops file
diff --git a/WebCore/inspector/InspectorStyleSheet.cpp b/WebCore/inspector/InspectorStyleSheet.cpp
index ad32d5a..2384795 100644
--- a/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/WebCore/inspector/InspectorStyleSheet.cpp
@@ -169,16 +169,17 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
return false;
} else {
unsigned textLength = propertyText.length();
+ unsigned disabledIndex = disabledIndexByOrdinal(index, false, allProperties);
if (!textLength) {
// Delete disabled property.
- m_disabledProperties.remove(disabledIndexByOrdinal(index, false, allProperties));
- return true;
+ m_disabledProperties.remove(disabledIndex);
+ } else {
+ // Patch disabled property text.
+ m_disabledProperties.at(disabledIndex).rawText = propertyText;
}
- // Patch disabled property text and range.
- property.rawText = propertyText;
- if (property.sourceData.range.end)
- property.sourceData.range.end = property.sourceData.range.start + textLength;
+ // We should not shift subsequent disabled properties when altering a disabled property.
+ return true;
}
} else {
// Insert at index.
@@ -204,7 +205,7 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
String textToSet = propertyText;
if (insertLast) {
propertyStart = sourceData->styleSourceData->styleBodyRange.end - sourceData->styleSourceData->styleBodyRange.start;
- if (propertyStart > 0 && propertyText.length()) {
+ if (propertyStart && propertyText.length()) {
const UChar* characters = text.characters();
unsigned curPos = propertyStart - 1; // The last position of style declaration, since propertyStart points past one.
@@ -225,7 +226,7 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText,
m_parentStyleSheet->setStyleText(m_style, text);
}
- // Recompute subsequent disabled property ranges.
+ // Recompute subsequent disabled property ranges if acting on a non-disabled property.
shiftDisabledProperties(disabledIndexByOrdinal(index, true, allProperties), propertyLengthDelta);
return true;
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 98a96d3..1ad0ece 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -1124,21 +1124,39 @@ WebInspector.StylePropertyTreeElement.prototype = {
get name()
{
- return this.property.name;
+ if (!this.disabled || !this.property.text)
+ return this.property.name;
+
+ var text = this.property.text;
+ var index = text.indexOf(":");
+ if (index < 1)
+ return this.property.name;
+
+ return text.substring(0, index).trim();
},
get priority()
{
if (this.disabled)
- return this.property.priority;
- return (this.shorthand ? this.style.getShorthandPriority(this.name) : this.property.priority);
+ return ""; // rely upon raw text to render it in the value field
+ return this.property.priority;
},
get value()
{
- if (this.disabled)
+ if (!this.disabled || !this.property.text)
+ return this.property.value;
+
+ var match = this.property.text.match(/(.*);\s*/);
+ if (!match || !match[1])
+ return this.property.value;
+
+ var text = match[1];
+ var index = text.indexOf(":");
+ if (index < 1)
return this.property.value;
- return (this.shorthand ? this.style.getShorthandValue(this.name) : this.property.value);
+
+ return text.substring(index + 1).trim();
},
get parsedOk()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list