Modified: trunk/LayoutTests/ChangeLog (92763 => 92764)
--- trunk/LayoutTests/ChangeLog 2011-08-10 11:53:31 UTC (rev 92763)
+++ trunk/LayoutTests/ChangeLog 2011-08-10 13:36:50 UTC (rev 92764)
@@ -1,3 +1,12 @@
+2011-08-10 Alexander Pavlov <[email protected]>
+
+ Web Inspector: [REGRESSION] Editor lost after committing a CSS property value for inline style
+ https://bugs.webkit.org/show_bug.cgi?id=65918
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/styles/styles-commit-editing.html:
+
2011-08-10 Kent Tamura <[email protected]>
Move <input type=datetime> tests to fast/forms/datetime/
Modified: trunk/LayoutTests/inspector/styles/styles-commit-editing.html (92763 => 92764)
--- trunk/LayoutTests/inspector/styles/styles-commit-editing.html 2011-08-10 11:53:31 UTC (rev 92763)
+++ trunk/LayoutTests/inspector/styles/styles-commit-editing.html 2011-08-10 13:36:50 UTC (rev 92764)
@@ -34,6 +34,10 @@
function step2()
{
+ if (!WebInspector.isEditingAnyField()) {
+ InspectorTest.addResult("No new property editor active!");
+ InspectorTest.completeTest();
+ }
InspectorTest.selectNodeWithId("other");
InspectorTest.runAfterPendingDispatches(step3);
}
Modified: trunk/Source/WebCore/ChangeLog (92763 => 92764)
--- trunk/Source/WebCore/ChangeLog 2011-08-10 11:53:31 UTC (rev 92763)
+++ trunk/Source/WebCore/ChangeLog 2011-08-10 13:36:50 UTC (rev 92764)
@@ -1,3 +1,19 @@
+2011-08-10 Alexander Pavlov <[email protected]>
+
+ Web Inspector: [REGRESSION] Editor lost after committing a CSS property value for inline style
+ https://bugs.webkit.org/show_bug.cgi?id=65918
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._innerUpdate.stylesCallback):
+ (WebInspector.StylesSidebarPane.prototype._innerUpdate.computedStyleCallback):
+ (WebInspector.StylesSidebarPane.prototype._innerUpdate):
+ (WebInspector.StylePropertyTreeElement.prototype):
+ (WebInspector.StylePropertyTreeElement.prototype.event):
+ (WebInspector.StylePropertyTreeElement.prototype.styleText.updateInterface.majorChange.isRevert.parentPane):
+ (WebInspector.StylePropertyTreeElement.prototype.styleText.updateInterface.majorChange.isRevert):
+
2011-08-10 Yuta Kitamura <[email protected]>
WebSocket: Add binaryType attribute
Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (92763 => 92764)
--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2011-08-10 11:53:31 UTC (rev 92763)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2011-08-10 13:36:50 UTC (rev 92764)
@@ -239,13 +239,15 @@
this._innerUpdate(refresh, null);
},
- _innerUpdate: function(refresh, editedSection)
+ _innerUpdate: function(refresh, editedSection, userCallback)
{
var node = this.node;
if (!node) {
this._sectionsContainer.removeChildren();
this._computedStylePane.bodyElement.removeChildren();
this.sections = {};
+ if (userCallback)
+ userCallback();
return;
}
@@ -253,12 +255,16 @@
{
if (this.node === node && styles)
this._rebuildUpdate(node, styles);
+ if (userCallback)
+ userCallback();
}
function computedStyleCallback(computedStyle)
{
if (this.node === node && computedStyle)
this._refreshUpdate(node, computedStyle, editedSection);
+ if (userCallback)
+ userCallback();
}
if (refresh)
@@ -1623,16 +1629,14 @@
this.tooltip = this.property.propertyText;
},
- _updateAll: function()
+ _updatePane: function(userCallback)
{
- if (!this.treeOutline)
- return;
- if (this.treeOutline.section && this.treeOutline.section.pane)
- this.treeOutline.section.pane._innerUpdate(true, this.treeOutline.section);
- else if (this.treeOutline.section)
- this.treeOutline.section.update(true);
- else
- this.updateTitle(); // FIXME: this will not show new properties. But we don't hit this case yet.
+ if (this.treeOutline && this.treeOutline.section && this.treeOutline.section.pane)
+ this.treeOutline.section.pane._innerUpdate(true, this.treeOutline.section, userCallback);
+ else {
+ if (userCallback)
+ userCallback();
+ }
},
toggleEnabled: function(event)
@@ -1650,7 +1654,7 @@
if (this.treeOutline.section && this.treeOutline.section.pane)
this.treeOutline.section.pane.dispatchEventToListeners("style property toggled");
- this._updateAll();
+ this._updatePane();
}
this.property.setDisabled(disabled, callback.bind(this));
@@ -2092,6 +2096,12 @@
applyStyleText: function(styleText, updateInterface, majorChange, isRevert)
{
+ function userOperationFinishedCallback(parentPane, updateInterface)
+ {
+ if (updateInterface)
+ delete parentPane._userOperation;
+ }
+
// Leave a way to cancel editing after incremental changes.
if (!isRevert && !updateInterface && !this._hasBeenModifiedIncrementally()) {
// Remember the rule's original CSS text on [Page](Up|Down), so it can be restored
@@ -2111,16 +2121,17 @@
}
var currentNode = this._parentPane.node;
- this._parentPane._userOperation = true;
+ if (updateInterface)
+ this._parentPane._userOperation = true;
- function callback(originalPropertyText, newStyle)
+ function callback(userCallback, originalPropertyText, newStyle)
{
- delete this._parentPane._userOperation;
if (!newStyle) {
if (updateInterface) {
// It did not apply, cancel editing.
this._revertStyleUponEditingCanceled(originalPropertyText);
}
+ userCallback();
return;
}
@@ -2131,15 +2142,19 @@
if (section && section.pane)
section.pane.dispatchEventToListeners("style edited");
- if (updateInterface && currentNode === section.pane.node)
- this._updateAll();
+ if (updateInterface && currentNode === section.pane.node) {
+ this._updatePane(userCallback);
+ return;
+ }
+
+ userCallback();
}
// Append a ";" if the new text does not end in ";".
// FIXME: this does not handle trailing comments.
if (styleText.length && !/;\s*$/.test(styleText))
styleText += ";";
- this.property.setText(styleText, majorChange, callback.bind(this, this.originalPropertyText));
+ this.property.setText(styleText, majorChange, callback.bind(this, userOperationFinishedCallback.bind(null, this._parentPane, updateInterface), this.originalPropertyText));
}
}