<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[179286] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/179286">179286</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2015-01-28 13:45:00 -0800 (Wed, 28 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
https://bugs.webkit.org/show_bug.cgi?id=140961
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* inspector/protocol/CSS.json: Remove unused protocol methods.
Source/WebCore:
No new tests, no behavior changed.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setPropertyText): Deleted.
(WebCore::InspectorCSSAgent::toggleProperty): Deleted.
* inspector/InspectorCSSAgent.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::InspectorStyle):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::InspectorStyleSheet::InspectorStyleSheet):
(WebCore::InspectorStyleSheet::reparseStyleSheet):
(WebCore::InspectorStyleSheet::inspectorStyleForId):
(WebCore::InspectorStyle::setPropertyText): Deleted.
(WebCore::InspectorStyle::toggleProperty): Deleted.
(WebCore::InspectorStyle::newLineAndWhitespaceDelimiters): Deleted.
(WebCore::InspectorStyleSheet::setPropertyText): Deleted.
(WebCore::InspectorStyleSheet::toggleProperty): Deleted.
(WebCore::InspectorStyleSheet::rememberInspectorStyle): Deleted.
(WebCore::InspectorStyleSheet::forgetInspectorStyle): Deleted.
(WebCore::InspectorStyleSheet::revalidateStyle): Deleted.
* inspector/InspectorStyleSheet.h:
* inspector/InspectorStyleTextEditor.cpp: Removed.
* inspector/InspectorStyleTextEditor.h: Removed.
Source/WebInspectorUI:
Setters for CSSProperty (except override) are not used, so delete them. These setters
and their callees in DOMNodeStyles were the only clients of the removed protocol commands.
* UserInterface/Models/CSSProperty.js:
(WebInspector.CSSProperty.prototype.update):
(WebInspector.CSSProperty.prototype.get name):
(WebInspector.CSSProperty.prototype.get value):
(WebInspector.CSSProperty.prototype.get priority):
(WebInspector.CSSProperty.prototype.hasOtherVendorNameOrKeyword):
(WebInspector.CSSProperty.prototype.set text): Deleted.
(WebInspector.CSSProperty.prototype.set name): Deleted.
(WebInspector.CSSProperty.prototype.set value): Deleted.
(WebInspector.CSSProperty.prototype.set important): Deleted.
(WebInspector.CSSProperty.prototype.set priority): Deleted.
(WebInspector.CSSProperty.prototype.set enabled): Deleted.
(WebInspector.CSSProperty.prototype.add): Deleted.
(WebInspector.CSSProperty.prototype.remove): Deleted.
(WebInspector.CSSProperty.prototype._updatePropertySoon.performUpdate): Deleted.
(WebInspector.CSSProperty.prototype._updatePropertySoon): Deleted.
(WebInspector.CSSProperty.prototype._cancelPendingUpdate): Deleted.
* UserInterface/Models/CSSStyleDeclaration.js:
(WebInspector.CSSStyleDeclaration.prototype.addProperty): Deleted.
(WebInspector.CSSStyleDeclaration.prototype.removeProperty): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.addEmptyRule):
(WebInspector.DOMNodeStyles.prototype.addRule): Deleted.
(WebInspector.DOMNodeStyles.prototype.changeProperty): Deleted.
(WebInspector.DOMNodeStyles.prototype.changePropertyText): Deleted.
(WebInspector.DOMNodeStyles.prototype.changePropertyEnabledState): Deleted.
(WebInspector.DOMNodeStyles.prototype.addProperty): Deleted.
(WebInspector.DOMNodeStyles.prototype.removeProperty): Deleted.
(WebInspector.DOMNodeStyles.prototype._handlePropertyChange): Deleted.
* UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype._newRuleClicked):
* Versions/Inspector-iOS-6.0.json:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolCSSjson">trunk/Source/JavaScriptCore/inspector/protocol/CSS.json</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorAllInOnecpp">trunk/Source/WebCore/inspector/InspectorAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgenth">trunk/Source/WebCore/inspector/InspectorCSSAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheetcpp">trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheeth">trunk/Source/WebCore/inspector/InspectorStyleSheet.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSPropertyjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLegacy60InspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLegacy70InspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLegacy80InspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIVersionsInspectoriOS60json">trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json</a></li>
<li><a href="#trunkSourceWebInspectorUIVersionsInspectoriOS70json">trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json</a></li>
<li><a href="#trunkSourceWebInspectorUIVersionsInspectoriOS80json">trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleTextEditorcpp">trunk/Source/WebCore/inspector/InspectorStyleTextEditor.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleTextEditorh">trunk/Source/WebCore/inspector/InspectorStyleTextEditor.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2015-01-28 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=140961
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/protocol/CSS.json: Remove unused protocol methods.
+
</ins><span class="cx"> 2015-01-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolCSSjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/CSS.json (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/CSS.json        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/JavaScriptCore/inspector/protocol/CSS.json        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -318,31 +318,6 @@
</span><span class="cx"> "description": "Sets the new <code>text</code> for the respective style."
</span><span class="cx"> },
</span><span class="cx"> {
</span><del>- "name": "setPropertyText",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "text", "type": "string" },
- { "name": "overwrite", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property text modification." }
- ],
- "description": "Sets the new <code>text</code> for a property in the respective style, at offset <code>propertyIndex</code>. If <code>overwrite</code> is <code>true</code>, a property at the given offset is overwritten, otherwise inserted. <code>text</code> entirely replaces the property <code>name: value</code>."
- },
- {
- "name": "toggleProperty",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "disable", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property toggling." }
- ],
- "description": "Toggles the property in the respective style, at offset <code>propertyIndex</code>. The <code>disable</code> parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If <code>disable == false</code>, the property gets put back into its original place in the style declaration."
- },
- {
</del><span class="cx"> "name": "setRuleSelector",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "ruleId", "$ref": "CSSRuleId" },
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1773,7 +1773,6 @@
</span><span class="cx"> inspector/InspectorPageAgent.cpp
</span><span class="cx"> inspector/InspectorResourceAgent.cpp
</span><span class="cx"> inspector/InspectorStyleSheet.cpp
</span><del>- inspector/InspectorStyleTextEditor.cpp
</del><span class="cx"> inspector/InspectorTimelineAgent.cpp
</span><span class="cx"> inspector/InspectorWorkerAgent.cpp
</span><span class="cx"> inspector/InstrumentingAgents.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/ChangeLog        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2015-01-28 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=140961
+
+ Reviewed by Timothy Hatcher.
+
+ No new tests, no behavior changed.
+
+ * CMakeLists.txt:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/InspectorAllInOne.cpp:
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::setPropertyText): Deleted.
+ (WebCore::InspectorCSSAgent::toggleProperty): Deleted.
+ * inspector/InspectorCSSAgent.h:
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::InspectorStyle):
+ (WebCore::InspectorStyle::populateAllProperties):
+ (WebCore::InspectorStyleSheet::InspectorStyleSheet):
+ (WebCore::InspectorStyleSheet::reparseStyleSheet):
+ (WebCore::InspectorStyleSheet::inspectorStyleForId):
+ (WebCore::InspectorStyle::setPropertyText): Deleted.
+ (WebCore::InspectorStyle::toggleProperty): Deleted.
+ (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters): Deleted.
+ (WebCore::InspectorStyleSheet::setPropertyText): Deleted.
+ (WebCore::InspectorStyleSheet::toggleProperty): Deleted.
+ (WebCore::InspectorStyleSheet::rememberInspectorStyle): Deleted.
+ (WebCore::InspectorStyleSheet::forgetInspectorStyle): Deleted.
+ (WebCore::InspectorStyleSheet::revalidateStyle): Deleted.
+ * inspector/InspectorStyleSheet.h:
+ * inspector/InspectorStyleTextEditor.cpp: Removed.
+ * inspector/InspectorStyleTextEditor.h: Removed.
+
</ins><span class="cx"> 2015-01-28 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Simple line layout: Move FlowContents iterator interface to FlowContentsIterator.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -18095,14 +18095,6 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorStyleTextEditor.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorTimelineAgent.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -21301,7 +21293,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorPageAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorResourceAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorStyleSheet.h" />
</span><del>- <ClInclude Include="..\inspector\InspectorStyleTextEditor.h" />
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorTimelineAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorWebAgentBase.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorWorkerAgent.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -4689,9 +4689,6 @@
</span><span class="cx"> <ClCompile Include="..\inspector\InspectorStyleSheet.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorStyleTextEditor.cpp">
- <Filter>inspector</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorTimelineAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -11898,9 +11895,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorStyleSheet.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\inspector\InspectorStyleTextEditor.h">
- <Filter>inspector</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorTimelineAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -2552,8 +2552,6 @@
</span><span class="cx">                 81AC6C36131C57D30009A7E0 /* StringCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 81AC6C35131C57D30009A7E0 /* StringCallback.h */; };
</span><span class="cx">                 81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */; };
</span><span class="cx">                 81F65FF613788FAA00FF6F2D /* DragState.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F65FF513788FAA00FF6F2D /* DragState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82889B4A13C62392009A6156 /* InspectorStyleTextEditor.cpp */; };
-                82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 82889B4B13C62392009A6156 /* InspectorStyleTextEditor.h */; };
</del><span class="cx">                 82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82AB1741124B99EC00C5069D /* InspectorCSSAgent.cpp */; };
</span><span class="cx">                 82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB1742124B99EC00C5069D /* InspectorCSSAgent.h */; };
</span><span class="cx">                 82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */; };
</span><span class="lines">@@ -9751,8 +9749,6 @@
</span><span class="cx">                 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBCursor.h; sourceTree = "<group>"; };
</span><span class="cx">                 81F65FF513788FAA00FF6F2D /* DragState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragState.h; sourceTree = "<group>"; };
</span><span class="cx">                 8225432CA9D4B4CF4628EC7F /* JSBeforeUnloadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBeforeUnloadEvent.cpp; sourceTree = "<group>"; };
</span><del>-                82889B4A13C62392009A6156 /* InspectorStyleTextEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorStyleTextEditor.cpp; sourceTree = "<group>"; };
-                82889B4B13C62392009A6156 /* InspectorStyleTextEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorStyleTextEditor.h; sourceTree = "<group>"; };
</del><span class="cx">                 82AB1741124B99EC00C5069D /* InspectorCSSAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 82AB1742124B99EC00C5069D /* InspectorCSSAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorStyleSheet.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -15299,8 +15295,6 @@
</span><span class="cx">                                 82AB1772125C826700C5069D /* InspectorResourceAgent.h */,
</span><span class="cx">                                 82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */,
</span><span class="cx">                                 82AB1770125C826700C5069D /* InspectorStyleSheet.h */,
</span><del>-                                82889B4A13C62392009A6156 /* InspectorStyleTextEditor.cpp */,
-                                82889B4B13C62392009A6156 /* InspectorStyleTextEditor.h */,
</del><span class="cx">                                 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
</span><span class="cx">                                 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
</span><span class="cx">                                 A593CF8A1840535200BFCE27 /* InspectorWebAgentBase.h */,
</span><span class="lines">@@ -24763,7 +24757,6 @@
</span><span class="cx">                                 99CC0B6718BE9F15006CEBCC /* InspectorReplayAgent.h in Headers */,
</span><span class="cx">                                 82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
</span><span class="cx">                                 82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
</span><del>-                                82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
</del><span class="cx">                                 754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
</span><span class="cx">                                 A593CF8B1840535200BFCE27 /* InspectorWebAgentBase.h in Headers */,
</span><span class="cx">                                 F3810C1C1365A49600ED6E33 /* InspectorWorkerAgent.h in Headers */,
</span><span class="lines">@@ -28236,7 +28229,6 @@
</span><span class="cx">                                 99CC0B6618BE9F15006CEBCC /* InspectorReplayAgent.cpp in Sources */,
</span><span class="cx">                                 82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
</span><span class="cx">                                 82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
</span><del>-                                82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
</del><span class="cx">                                 754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
</span><span class="cx">                                 F3810C1B1365A49600ED6E33 /* InspectorWorkerAgent.cpp in Sources */,
</span><span class="cx">                                 F350B73513F1377D00880C43 /* InstrumentingAgents.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorAllInOne.cpp (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -50,7 +50,6 @@
</span><span class="cx"> #include "InspectorPageAgent.cpp"
</span><span class="cx"> #include "InspectorResourceAgent.cpp"
</span><span class="cx"> #include "InspectorStyleSheet.cpp"
</span><del>-#include "InspectorStyleTextEditor.cpp"
</del><span class="cx"> #include "InspectorTimelineAgent.cpp"
</span><span class="cx"> #include "InspectorWorkerAgent.cpp"
</span><span class="cx"> #include "InstrumentingAgents.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -259,99 +259,6 @@
</span><span class="cx"> String m_oldText;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class InspectorCSSAgent::SetPropertyTextAction final : public InspectorCSSAgent::StyleSheetAction {
- WTF_MAKE_NONCOPYABLE(SetPropertyTextAction);
-public:
- SetPropertyTextAction(InspectorStyleSheet* styleSheet, const InspectorCSSId& cssId, unsigned propertyIndex, const String& text, bool overwrite)
- : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("SetPropertyText"), styleSheet)
- , m_cssId(cssId)
- , m_propertyIndex(propertyIndex)
- , m_text(text)
- , m_overwrite(overwrite)
- {
- }
-
- virtual String toString() override
- {
- return mergeId() + ": " + m_oldText + " -> " + m_text;
- }
-
- virtual bool perform(ExceptionCode& ec) override
- {
- return redo(ec);
- }
-
- virtual bool undo(ExceptionCode& ec) override
- {
- String placeholder;
- return m_styleSheet->setPropertyText(m_cssId, m_propertyIndex, m_overwrite ? m_oldText : "", true, &placeholder, ec);
- }
-
- virtual bool redo(ExceptionCode& ec) override
- {
- String oldText;
- bool result = m_styleSheet->setPropertyText(m_cssId, m_propertyIndex, m_text, m_overwrite, &oldText, ec);
- m_oldText = oldText.stripWhiteSpace();
- // FIXME: remove this once the model handles this case.
- if (!m_oldText.endsWith(';'))
- m_oldText.append(';');
-
- return result;
- }
-
- virtual String mergeId() override
- {
- return String::format("SetPropertyText %s:%u:%s", m_styleSheet->id().utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false");
- }
-
- virtual void merge(std::unique_ptr<Action> action) override
- {
- ASSERT(action->mergeId() == mergeId());
-
- SetPropertyTextAction* other = static_cast<SetPropertyTextAction*>(action.get());
- m_text = other->m_text;
- }
-
-private:
- InspectorCSSId m_cssId;
- unsigned m_propertyIndex;
- String m_text;
- String m_oldText;
- bool m_overwrite;
-};
-
-class InspectorCSSAgent::TogglePropertyAction final : public InspectorCSSAgent::StyleSheetAction {
- WTF_MAKE_NONCOPYABLE(TogglePropertyAction);
-public:
- TogglePropertyAction(InspectorStyleSheet* styleSheet, const InspectorCSSId& cssId, unsigned propertyIndex, bool disable)
- : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("ToggleProperty"), styleSheet)
- , m_cssId(cssId)
- , m_propertyIndex(propertyIndex)
- , m_disable(disable)
- {
- }
-
- virtual bool perform(ExceptionCode& ec) override
- {
- return redo(ec);
- }
-
- virtual bool undo(ExceptionCode& ec) override
- {
- return m_styleSheet->toggleProperty(m_cssId, m_propertyIndex, !m_disable, ec);
- }
-
- virtual bool redo(ExceptionCode& ec) override
- {
- return m_styleSheet->toggleProperty(m_cssId, m_propertyIndex, m_disable, ec);
- }
-
-private:
- InspectorCSSId m_cssId;
- unsigned m_propertyIndex;
- bool m_disable;
-};
-
</del><span class="cx"> class InspectorCSSAgent::SetRuleSelectorAction final : public InspectorCSSAgent::StyleSheetAction {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(SetRuleSelectorAction);
</span><span class="cx"> public:
</span><span class="lines">@@ -733,38 +640,6 @@
</span><span class="cx"> errorString = InspectorDOMAgent::toErrorString(ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorCSSAgent::setPropertyText(ErrorString& errorString, const RefPtr<InspectorObject>&& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
-{
- InspectorCSSId compoundId(fullStyleId.copyRef());
- ASSERT(!compoundId.isEmpty());
-
- InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
- if (!inspectorStyleSheet)
- return;
-
- ExceptionCode ec = 0;
- bool success = m_domAgent->history()->perform(std::make_unique<SetPropertyTextAction>(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite), ec);
- if (success)
- result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
- errorString = InspectorDOMAgent::toErrorString(ec);
-}
-
-void InspectorCSSAgent::toggleProperty(ErrorString& errorString, const RefPtr<InspectorObject>&& fullStyleId, int propertyIndex, bool disable, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
-{
- InspectorCSSId compoundId(fullStyleId.copyRef());
- ASSERT(!compoundId.isEmpty());
-
- InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
- if (!inspectorStyleSheet)
- return;
-
- ExceptionCode ec = 0;
- bool success = m_domAgent->history()->perform(std::make_unique<TogglePropertyAction>(inspectorStyleSheet, compoundId, propertyIndex, disable), ec);
- if (success)
- result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
- errorString = InspectorDOMAgent::toErrorString(ec);
-}
-
</del><span class="cx"> void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const RefPtr<InspectorObject>&& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
</span><span class="cx"> {
</span><span class="cx"> InspectorCSSId compoundId(fullRuleId.copyRef());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -116,8 +116,6 @@
</span><span class="cx"> virtual void getStyleSheetText(ErrorString&, const String& styleSheetId, String* result) override;
</span><span class="cx"> virtual void setStyleSheetText(ErrorString&, const String& styleSheetId, const String& text) override;
</span><span class="cx"> virtual void setStyleText(ErrorString&, const RefPtr<Inspector::InspectorObject>&& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
</span><del>- virtual void setPropertyText(ErrorString&, const RefPtr<Inspector::InspectorObject>&& styleId, int propertyIndex, const String& text, bool overwrite, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
- virtual void toggleProperty(ErrorString&, const RefPtr<Inspector::InspectorObject>&& styleId, int propertyIndex, bool disable, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
</del><span class="cx"> virtual void setRuleSelector(ErrorString&, const RefPtr<Inspector::InspectorObject>&& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
</span><span class="cx"> virtual void addRule(ErrorString&, int contextNodeId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
</span><span class="cx"> virtual void getSupportedCSSProperties(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSPropertyInfo>>& result) override;
</span><span class="lines">@@ -128,8 +126,6 @@
</span><span class="cx"> class StyleSheetAction;
</span><span class="cx"> class SetStyleSheetTextAction;
</span><span class="cx"> class SetStyleTextAction;
</span><del>- class SetPropertyTextAction;
- class TogglePropertyAction;
</del><span class="cx"> class SetRuleSelectorAction;
</span><span class="cx"> class AddRuleAction;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -289,7 +289,6 @@
</span><span class="cx"> : m_styleId(styleId)
</span><span class="cx"> , m_style(style)
</span><span class="cx"> , m_parentStyleSheet(parentStyleSheet)
</span><del>- , m_formatAcquired(false)
</del><span class="cx"> {
</span><span class="cx"> ASSERT(m_style);
</span><span class="cx"> }
</span><span class="lines">@@ -332,114 +331,6 @@
</span><span class="cx"> return WTF::move(result);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// This method does the following preprocessing of |propertyText| with |overwrite| == false and |index| past the last active property:
-// - If the last property (if present) has no closing ";", the ";" is prepended to the current |propertyText| value.
-// - A heuristic formatting is attempted to retain the style structure.
-//
-// The propertyText (if not empty) is checked to be a valid style declaration (containing at least one property). If not,
-// the method returns false (denoting an error).
-bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, bool overwrite, String* oldText, ExceptionCode& ec)
-{
- ASSERT(m_parentStyleSheet);
- DEPRECATED_DEFINE_STATIC_LOCAL(String, bogusPropertyName, (ASCIILiteral("-webkit-boguz-propertee")));
-
- if (!m_parentStyleSheet->ensureParsedDataReady()) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- if (propertyText.stripWhiteSpace().length()) {
- RefPtr<MutableStyleProperties> tempMutableStyle = MutableStyleProperties::create();
- RefPtr<CSSRuleSourceData> sourceData = CSSRuleSourceData::create(CSSRuleSourceData::STYLE_RULE);
- Document* ownerDocument = m_parentStyleSheet->pageStyleSheet() ? m_parentStyleSheet->pageStyleSheet()->ownerDocument() : nullptr;
- createCSSParser(ownerDocument)->parseDeclaration(tempMutableStyle.get(), propertyText + " " + bogusPropertyName + ": none", sourceData, &m_style->parentStyleSheet()->contents());
- Vector<CSSPropertySourceData>& propertyData = sourceData->styleSourceData->propertyData;
- unsigned propertyCount = propertyData.size();
-
- // At least one property + the bogus property added just above should be present.
- if (propertyCount < 2) {
- ec = SYNTAX_ERR;
- return false;
- }
-
- // Check for a proper propertyText termination (the parser could at least restore to the PROPERTY_NAME state).
- if (propertyData.at(propertyCount - 1).name != bogusPropertyName) {
- ec = SYNTAX_ERR;
- return false;
- }
- }
-
- RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
- if (!sourceData) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- String text;
- bool success = styleText(&text);
- if (!success) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- Vector<InspectorStyleProperty> allProperties;
- populateAllProperties(&allProperties);
-
- InspectorStyleTextEditor editor(&allProperties, &m_disabledProperties, text, newLineAndWhitespaceDelimiters());
- if (overwrite) {
- if (index >= allProperties.size()) {
- ec = INDEX_SIZE_ERR;
- return false;
- }
- *oldText = allProperties.at(index).rawText;
- editor.replaceProperty(index, propertyText);
- } else
- editor.insertProperty(index, propertyText, sourceData->ruleBodyRange.length());
-
- return applyStyleText(editor.styleText());
-}
-
-bool InspectorStyle::toggleProperty(unsigned index, bool disable, ExceptionCode& ec)
-{
- ASSERT(m_parentStyleSheet);
- if (!m_parentStyleSheet->ensureParsedDataReady()) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return false;
- }
-
- RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
- if (!sourceData) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- String text;
- bool success = styleText(&text);
- if (!success) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- Vector<InspectorStyleProperty> allProperties;
- populateAllProperties(&allProperties);
- if (index >= allProperties.size()) {
- ec = INDEX_SIZE_ERR;
- return false;
- }
-
- InspectorStyleProperty& property = allProperties.at(index);
- if (property.disabled == disable)
- return true; // Idempotent operation.
-
- InspectorStyleTextEditor editor(&allProperties, &m_disabledProperties, text, newLineAndWhitespaceDelimiters());
- if (disable)
- editor.disableProperty(index);
- else
- editor.enableProperty(index);
-
- return applyStyleText(editor.styleText());
-}
-
</del><span class="cx"> bool InspectorStyle::getText(String* result) const
</span><span class="cx"> {
</span><span class="cx"> // Precondition: m_parentStyleSheet->ensureParsedDataReady() has been called successfully.
</span><span class="lines">@@ -460,11 +351,6 @@
</span><span class="cx"> bool InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>* result) const
</span><span class="cx"> {
</span><span class="cx"> HashSet<String> sourcePropertyNames;
</span><del>- unsigned disabledIndex = 0;
- unsigned disabledLength = m_disabledProperties.size();
- InspectorStyleProperty disabledProperty;
- if (disabledIndex < disabledLength)
- disabledProperty = m_disabledProperties.at(disabledIndex);
</del><span class="cx">
</span><span class="cx"> RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
</span><span class="cx"> Vector<CSSPropertySourceData>* sourcePropertyData = sourceData ? &(sourceData->styleSourceData->propertyData) : nullptr;
</span><span class="lines">@@ -473,11 +359,6 @@
</span><span class="cx"> bool isStyleTextKnown = styleText(&styleDeclaration);
</span><span class="cx"> ASSERT_UNUSED(isStyleTextKnown, isStyleTextKnown);
</span><span class="cx"> for (Vector<CSSPropertySourceData>::const_iterator it = sourcePropertyData->begin(); it != sourcePropertyData->end(); ++it) {
</span><del>- while (disabledIndex < disabledLength && disabledProperty.sourceData.range.start <= it->range.start) {
- result->append(disabledProperty);
- if (++disabledIndex < disabledLength)
- disabledProperty = m_disabledProperties.at(disabledIndex);
- }
</del><span class="cx"> InspectorStyleProperty p(*it, true, false);
</span><span class="cx"> p.setRawTextFromStyleDeclaration(styleDeclaration);
</span><span class="cx"> result->append(p);
</span><span class="lines">@@ -485,11 +366,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- while (disabledIndex < disabledLength) {
- disabledProperty = m_disabledProperties.at(disabledIndex++);
- result->append(disabledProperty);
- }
-
</del><span class="cx"> for (int i = 0, size = m_style->length(); i < size; ++i) {
</span><span class="cx"> String name = m_style->item(i);
</span><span class="cx"> if (sourcePropertyNames.contains(name.lower()))
</span><span class="lines">@@ -685,71 +561,6 @@
</span><span class="cx"> return properties;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NewLineAndWhitespace& InspectorStyle::newLineAndWhitespaceDelimiters() const
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(String, defaultPrefix, (ASCIILiteral(" ")));
-
- if (m_formatAcquired)
- return m_format;
-
- RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
- Vector<CSSPropertySourceData>* sourcePropertyData = sourceData ? &(sourceData->styleSourceData->propertyData) : nullptr;
- int propertyCount;
- if (!sourcePropertyData || !(propertyCount = sourcePropertyData->size())) {
- m_format.first = "\n";
- m_format.second = defaultPrefix;
- return m_format; // Do not remember the default formatting and attempt to acquire it later.
- }
-
- String text;
- bool success = styleText(&text);
- ASSERT_UNUSED(success, success);
-
- m_formatAcquired = true;
-
- String candidatePrefix = defaultPrefix;
- StringBuilder formatLineFeed;
- StringBuilder prefix;
- int scanStart = 0;
- int propertyIndex = 0;
- bool isFullPrefixScanned = false;
- bool lineFeedTerminated = false;
- while (propertyIndex < propertyCount) {
- const WebCore::CSSPropertySourceData& currentProperty = sourcePropertyData->at(propertyIndex++);
-
- bool processNextProperty = false;
- int scanEnd = currentProperty.range.start;
- for (int i = scanStart; i < scanEnd; ++i) {
- UChar ch = text[i];
- bool isLineFeed = isHTMLLineBreak(ch);
- if (isLineFeed) {
- if (!lineFeedTerminated)
- formatLineFeed.append(ch);
- prefix.clear();
- } else if (isHTMLSpace(ch))
- prefix.append(ch);
- else {
- candidatePrefix = prefix.toString();
- prefix.clear();
- scanStart = currentProperty.range.end;
- ++propertyIndex;
- processNextProperty = true;
- break;
- }
- if (!isLineFeed && formatLineFeed.length())
- lineFeedTerminated = true;
- }
- if (!processNextProperty) {
- isFullPrefixScanned = true;
- break;
- }
- }
-
- m_format.first = formatLineFeed.toString();
- m_format.second = isFullPrefixScanned ? prefix.toString() : candidatePrefix;
- return m_format;
-}
-
</del><span class="cx"> Ref<InspectorStyleSheet> InspectorStyleSheet::create(InspectorPageAgent* pageAgent, const String& id, RefPtr<CSSStyleSheet>&& pageStyleSheet, Inspector::Protocol::CSS::StyleSheetOrigin origin, const String& documentURL, Listener* listener)
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(*new InspectorStyleSheet(pageAgent, id, WTF::move(pageStyleSheet), origin, documentURL, listener));
</span><span class="lines">@@ -769,7 +580,6 @@
</span><span class="cx"> , m_pageStyleSheet(WTF::move(pageStyleSheet))
</span><span class="cx"> , m_origin(origin)
</span><span class="cx"> , m_documentURL(documentURL)
</span><del>- , m_isRevalidating(false)
</del><span class="cx"> , m_listener(listener)
</span><span class="cx"> {
</span><span class="cx"> m_parsedStyleSheet = new ParsedStyleSheet();
</span><span class="lines">@@ -797,7 +607,6 @@
</span><span class="cx"> CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get());
</span><span class="cx"> m_pageStyleSheet->contents().parseString(text);
</span><span class="cx"> m_pageStyleSheet->clearChildRuleCSSOMWrappers();
</span><del>- m_inspectorStyles.clear();
</del><span class="cx"> fireStyleSheetChanged();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -951,7 +760,6 @@
</span><span class="cx"> ASSERT(!id.isEmpty());
</span><span class="cx"> ensureFlatRules();
</span><span class="cx"> return id.ordinal() >= m_flatRules.size() ? nullptr : m_flatRules.at(id.ordinal()).get();
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody> InspectorStyleSheet::buildObjectForStyleSheet()
</span><span class="lines">@@ -1174,39 +982,6 @@
</span><span class="cx"> return success;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool InspectorStyleSheet::setPropertyText(const InspectorCSSId& id, unsigned propertyIndex, const String& text, bool overwrite, String* oldText, ExceptionCode& ec)
-{
- RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
- if (!inspectorStyle) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- bool success = inspectorStyle->setPropertyText(propertyIndex, text, overwrite, oldText, ec);
- if (success)
- fireStyleSheetChanged();
- return success;
-}
-
-bool InspectorStyleSheet::toggleProperty(const InspectorCSSId& id, unsigned propertyIndex, bool disable, ExceptionCode& ec)
-{
- RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
- if (!inspectorStyle) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
- bool success = inspectorStyle->toggleProperty(propertyIndex, disable, ec);
- if (success) {
- if (disable)
- rememberInspectorStyle(inspectorStyle.copyRef());
- else if (!inspectorStyle->hasDisabledProperties())
- forgetInspectorStyle(inspectorStyle->cssStyle());
- fireStyleSheetChanged();
- }
- return success;
-}
-
</del><span class="cx"> bool InspectorStyleSheet::getText(String* result) const
</span><span class="cx"> {
</span><span class="cx"> if (!ensureText())
</span><span class="lines">@@ -1236,22 +1011,9 @@
</span><span class="cx"> if (!style)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- InspectorStyleMap::iterator it = m_inspectorStyles.find(style);
- if (it == m_inspectorStyles.end())
- return InspectorStyle::create(id, style, this);
- return it->value;
</del><ins>+ return InspectorStyle::create(id, style, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorStyleSheet::rememberInspectorStyle(RefPtr<InspectorStyle>&& inspectorStyle)
-{
- m_inspectorStyles.set(inspectorStyle->cssStyle(), inspectorStyle);
-}
-
-void InspectorStyleSheet::forgetInspectorStyle(CSSStyleDeclaration* style)
-{
- m_inspectorStyles.remove(style);
-}
-
</del><span class="cx"> InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) const
</span><span class="cx"> {
</span><span class="cx"> unsigned index = ruleIndexByStyle(style);
</span><span class="lines">@@ -1391,29 +1153,6 @@
</span><span class="cx"> return ruleOrStyleId(&rule->style());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
-{
- if (m_isRevalidating)
- return;
-
- m_isRevalidating = true;
- ensureFlatRules();
- for (unsigned i = 0, size = m_flatRules.size(); i < size; ++i) {
- CSSStyleRule* parsedRule = m_flatRules.at(i).get();
- if (&parsedRule->style() == pageStyle) {
- if (parsedRule->styleRule().properties().asText() != pageStyle->cssText()) {
- // Clear the disabled properties for the invalid style here.
- m_inspectorStyles.remove(pageStyle);
-
- ExceptionCode ec = 0;
- setStyleText(pageStyle, pageStyle->cssText(), ec);
- }
- break;
- }
- }
- m_isRevalidating = false;
-}
-
</del><span class="cx"> bool InspectorStyleSheet::originalStyleSheetText(String* result) const
</span><span class="cx"> {
</span><span class="cx"> bool success = inlineStyleSheetText(result);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.h (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "CSSPropertySourceData.h"
</span><span class="cx"> #include "CSSStyleDeclaration.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><del>-#include "InspectorStyleTextEditor.h"
</del><span class="cx"> #include <inspector/InspectorProtocolObjects.h>
</span><span class="cx"> #include <inspector/InspectorValues.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="lines">@@ -134,9 +133,6 @@
</span><span class="cx"> CSSStyleDeclaration* cssStyle() const { return m_style.get(); }
</span><span class="cx"> RefPtr<Inspector::Protocol::CSS::CSSStyle> buildObjectForStyle() const;
</span><span class="cx"> Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSComputedStyleProperty>> buildArrayForComputedStyle() const;
</span><del>- bool hasDisabledProperties() const { return !m_disabledProperties.isEmpty(); }
- bool setPropertyText(unsigned index, const String& text, bool overwrite, String* oldText, ExceptionCode&);
- bool toggleProperty(unsigned index, bool disable, ExceptionCode&);
</del><span class="cx">
</span><span class="cx"> bool getText(String* result) const;
</span><span class="cx"> bool setText(const String&, ExceptionCode&);
</span><span class="lines">@@ -154,14 +150,10 @@
</span><span class="cx"> String shorthandValue(const String& shorthandProperty) const;
</span><span class="cx"> String shorthandPriority(const String& shorthandProperty) const;
</span><span class="cx"> Vector<String> longhandProperties(const String& shorthandProperty) const;
</span><del>- NewLineAndWhitespace& newLineAndWhitespaceDelimiters() const;
</del><span class="cx">
</span><span class="cx"> InspectorCSSId m_styleId;
</span><span class="cx"> RefPtr<CSSStyleDeclaration> m_style;
</span><span class="cx"> InspectorStyleSheet* m_parentStyleSheet;
</span><del>- Vector<InspectorStyleProperty> m_disabledProperties;
- mutable std::pair<String, String> m_format;
- mutable bool m_formatAcquired;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class InspectorStyleSheet : public RefCounted<InspectorStyleSheet> {
</span><span class="lines">@@ -194,8 +186,6 @@
</span><span class="cx"> RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, Element*);
</span><span class="cx"> RefPtr<Inspector::Protocol::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclaration*);
</span><span class="cx"> bool setStyleText(const InspectorCSSId&, const String& text, String* oldText, ExceptionCode&);
</span><del>- bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const String& text, bool overwrite, String* oldPropertyText, ExceptionCode&);
- bool toggleProperty(const InspectorCSSId&, unsigned propertyIndex, bool disable, ExceptionCode&);
</del><span class="cx">
</span><span class="cx"> virtual bool getText(String* result) const;
</span><span class="cx"> virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const;
</span><span class="lines">@@ -214,8 +204,6 @@
</span><span class="cx"> virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
</span><span class="cx"> virtual bool ensureParsedDataReady();
</span><span class="cx"> virtual RefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&);
</span><del>- virtual void rememberInspectorStyle(RefPtr<InspectorStyle>&&);
- virtual void forgetInspectorStyle(CSSStyleDeclaration*);
</del><span class="cx">
</span><span class="cx"> // Also accessed by friend class InspectorStyle.
</span><span class="cx"> virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&);
</span><span class="lines">@@ -231,7 +219,6 @@
</span><span class="cx"> bool ensureSourceData();
</span><span class="cx"> void ensureFlatRules() const;
</span><span class="cx"> bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newStyleText, String* result);
</span><del>- void revalidateStyle(CSSStyleDeclaration*);
</del><span class="cx"> bool originalStyleSheetText(String* result) const;
</span><span class="cx"> bool resourceStyleSheetText(String* result) const;
</span><span class="cx"> bool inlineStyleSheetText(String* result) const;
</span><span class="lines">@@ -244,9 +231,7 @@
</span><span class="cx"> RefPtr<CSSStyleSheet> m_pageStyleSheet;
</span><span class="cx"> Inspector::Protocol::CSS::StyleSheetOrigin m_origin;
</span><span class="cx"> String m_documentURL;
</span><del>- bool m_isRevalidating;
</del><span class="cx"> ParsedStyleSheet* m_parsedStyleSheet;
</span><del>- InspectorStyleMap m_inspectorStyles;
</del><span class="cx"> mutable CSSStyleRuleVector m_flatRules;
</span><span class="cx"> Listener* m_listener;
</span><span class="cx"> };
</span><span class="lines">@@ -267,8 +252,6 @@
</span><span class="cx"> virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const override { return 0; }
</span><span class="cx"> virtual bool ensureParsedDataReady() override;
</span><span class="cx"> virtual RefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&) override;
</span><del>- virtual void rememberInspectorStyle(RefPtr<InspectorStyle>&&) override { }
- virtual void forgetInspectorStyle(CSSStyleDeclaration*) override { }
</del><span class="cx">
</span><span class="cx"> // Also accessed by friend class InspectorStyle.
</span><span class="cx"> virtual bool setStyleText(CSSStyleDeclaration*, const String&, ExceptionCode&) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleTextEditorcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorStyleTextEditor.cpp (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleTextEditor.cpp        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorStyleTextEditor.cpp        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1,261 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorStyleTextEditor.h"
-
-#include "CSSPropertySourceData.h"
-#include "HTMLParserIdioms.h"
-#include "InspectorStyleSheet.h"
-
-using namespace Inspector;
-
-namespace WebCore {
-
-InspectorStyleTextEditor::InspectorStyleTextEditor(Vector<InspectorStyleProperty>* allProperties, Vector<InspectorStyleProperty>* disabledProperties, const String& styleText, const NewLineAndWhitespace& format)
- : m_allProperties(allProperties)
- , m_disabledProperties(disabledProperties)
- , m_styleText(styleText)
- , m_format(format)
-{
-}
-
-void InspectorStyleTextEditor::insertProperty(unsigned index, const String& propertyText, unsigned styleBodyLength)
-{
- long propertyStart = 0;
-
- bool insertLast = true;
- if (index < m_allProperties->size()) {
- const InspectorStyleProperty& property = m_allProperties->at(index);
- if (property.hasSource) {
- propertyStart = property.sourceData.range.start;
- // If inserting before a disabled property, it should be shifted, too.
- insertLast = false;
- }
- }
-
- bool insertFirstInSource = true;
- for (unsigned i = 0, size = m_allProperties->size(); i < index && i < size; ++i) {
- const InspectorStyleProperty& property = m_allProperties->at(i);
- if (property.hasSource && !property.disabled) {
- insertFirstInSource = false;
- break;
- }
- }
-
- bool insertLastInSource = true;
- for (unsigned i = index, size = m_allProperties->size(); i < size; ++i) {
- const InspectorStyleProperty& property = m_allProperties->at(i);
- if (property.hasSource && !property.disabled) {
- insertLastInSource = false;
- break;
- }
- }
-
- String textToSet = propertyText;
-
- int formattingPrependOffset = 0;
- if (insertLast && !insertFirstInSource) {
- propertyStart = styleBodyLength;
- if (propertyStart && textToSet.length()) {
- long curPos = propertyStart - 1; // The last position of style declaration, since propertyStart points past one.
- while (curPos && isHTMLSpace(m_styleText[curPos]))
- --curPos;
- if (curPos && m_styleText[curPos] != ';') {
- // Prepend a ";" to the property text if appending to a style declaration where
- // the last property has no trailing ";".
- textToSet = makeString(';', textToSet);
- formattingPrependOffset = 1;
- }
- }
- }
-
- const String& formatLineFeed = m_format.first;
- const String& formatPropertyPrefix = m_format.second;
- if (insertLastInSource) {
- long formatPropertyPrefixLength = formatPropertyPrefix.length();
- if (!formattingPrependOffset && (propertyStart < formatPropertyPrefixLength || m_styleText.substring(propertyStart - formatPropertyPrefixLength, formatPropertyPrefixLength) != formatPropertyPrefix)) {
- textToSet.insert(formatPropertyPrefix, formattingPrependOffset);
- if (!propertyStart || !isHTMLLineBreak(m_styleText[propertyStart - 1]))
- textToSet.insert(formatLineFeed, formattingPrependOffset);
- }
- if (!isHTMLLineBreak(m_styleText[propertyStart]))
- textToSet.append(formatLineFeed);
- } else {
- String fullPrefix = formatLineFeed + formatPropertyPrefix;
- long fullPrefixLength = fullPrefix.length();
- textToSet.append(fullPrefix);
- if (insertFirstInSource && (propertyStart < fullPrefixLength || m_styleText.substring(propertyStart - fullPrefixLength, fullPrefixLength) != fullPrefix))
- textToSet.insert(fullPrefix, formattingPrependOffset);
- }
- m_styleText.insert(textToSet, propertyStart);
-
- // Recompute disabled property ranges after an inserted property.
- long propertyLengthDelta = textToSet.length();
- shiftDisabledProperties(disabledIndexByOrdinal(index, true), propertyLengthDelta);
-}
-
-void InspectorStyleTextEditor::replaceProperty(unsigned index, const String& newText)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(index < m_allProperties->size());
-
- const InspectorStyleProperty& property = m_allProperties->at(index);
- if (!property.disabled) {
- SourceRange overwrittenRange;
- unsigned insertedLength;
- internalReplaceProperty(property, newText, &overwrittenRange, &insertedLength);
- long propertyLengthDelta = static_cast<long>(insertedLength) - static_cast<long>(overwrittenRange.length());
-
- // Recompute subsequent disabled property ranges if acting on a non-disabled property.
- shiftDisabledProperties(disabledIndexByOrdinal(index, true), propertyLengthDelta);
- } else {
- long textLength = newText.length();
- unsigned disabledIndex = disabledIndexByOrdinal(index, false);
- if (!textLength) {
- // Delete disabled property.
- m_disabledProperties->remove(disabledIndex);
- } else {
- // Patch disabled property text.
- m_disabledProperties->at(disabledIndex).rawText = newText;
- }
- }
-}
-
-void InspectorStyleTextEditor::removeProperty(unsigned index)
-{
- replaceProperty(index, "");
-}
-
-void InspectorStyleTextEditor::enableProperty(unsigned index)
-{
- ASSERT(m_allProperties->at(index).disabled);
-
- unsigned disabledIndex = disabledIndexByOrdinal(index, false);
- ASSERT(disabledIndex != UINT_MAX);
-
- InspectorStyleProperty disabledProperty = m_disabledProperties->at(disabledIndex);
- m_disabledProperties->remove(disabledIndex);
- SourceRange removedRange;
- unsigned insertedLength;
- internalReplaceProperty(disabledProperty, disabledProperty.rawText, &removedRange, &insertedLength);
- shiftDisabledProperties(disabledIndex, static_cast<long>(insertedLength) - static_cast<long>(removedRange.length()));
-}
-
-void InspectorStyleTextEditor::disableProperty(unsigned index)
-{
- ASSERT(!m_allProperties->at(index).disabled);
-
- const InspectorStyleProperty& property = m_allProperties->at(index);
- InspectorStyleProperty disabledProperty(property);
- disabledProperty.setRawTextFromStyleDeclaration(m_styleText);
- disabledProperty.disabled = true;
-
- SourceRange removedRange;
- unsigned insertedLength;
- internalReplaceProperty(property, "", &removedRange, &insertedLength);
-
- // If some preceding formatting has been removed, move the property to the start of the removed range.
- if (property.sourceData.range.start > removedRange.start)
- disabledProperty.sourceData.range.start = removedRange.start;
- disabledProperty.sourceData.range.end = disabledProperty.sourceData.range.start;
-
- // Add disabled property at correct position.
- unsigned insertionIndex = disabledIndexByOrdinal(index, true);
- if (insertionIndex == UINT_MAX)
- m_disabledProperties->append(disabledProperty);
- else {
- m_disabledProperties->insert(insertionIndex, disabledProperty);
- long styleLengthDelta = -(static_cast<long>(removedRange.length()));
- shiftDisabledProperties(insertionIndex + 1, styleLengthDelta); // Property removed from text - shift these back.
- }
-}
-
-unsigned InspectorStyleTextEditor::disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent)
-{
- unsigned disabledIndex = 0;
- for (unsigned i = 0, size = m_allProperties->size(); i < size; ++i) {
- if (m_allProperties->at(i).disabled) {
- if (i == ordinal || (canUseSubsequent && i > ordinal))
- return disabledIndex;
- ++disabledIndex;
- }
- }
-
- return UINT_MAX;
-}
-
-void InspectorStyleTextEditor::shiftDisabledProperties(unsigned fromIndex, long delta)
-{
- for (unsigned i = fromIndex, size = m_disabledProperties->size(); i < size; ++i) {
- SourceRange& range = m_disabledProperties->at(i).sourceData.range;
- range.start += delta;
- range.end += delta;
- }
-}
-
-void InspectorStyleTextEditor::internalReplaceProperty(const InspectorStyleProperty& property, const String& newText, SourceRange* removedRange, unsigned* insertedLength)
-{
- const SourceRange& range = property.sourceData.range;
- long replaceRangeStart = range.start;
- long replaceRangeEnd = range.end;
- long newTextLength = newText.length();
- String finalNewText = newText;
-
- // Removing a property - remove preceding prefix.
- String fullPrefix = m_format.first + m_format.second;
- long fullPrefixLength = fullPrefix.length();
- if (!newTextLength && fullPrefixLength) {
- if (replaceRangeStart >= fullPrefixLength && m_styleText.substring(replaceRangeStart - fullPrefixLength, fullPrefixLength) == fullPrefix)
- replaceRangeStart -= fullPrefixLength;
- } else if (newTextLength) {
- if (isHTMLLineBreak(newText[newTextLength - 1])) {
- // Coalesce newlines of the original and new property values (to avoid a lot of blank lines while incrementally applying property values).
- bool foundNewline = false;
- bool isLastNewline = false;
- int i;
- int textLength = m_styleText.length();
- for (i = replaceRangeEnd; i < textLength && isSpaceOrNewline(m_styleText[i]); ++i) {
- isLastNewline = isHTMLLineBreak(m_styleText[i]);
- if (isLastNewline)
- foundNewline = true;
- else if (foundNewline && !isLastNewline) {
- replaceRangeEnd = i;
- break;
- }
- }
- if (foundNewline && isLastNewline)
- replaceRangeEnd = i;
- }
-
- if (fullPrefixLength > replaceRangeStart || m_styleText.substring(replaceRangeStart - fullPrefixLength, fullPrefixLength) != fullPrefix)
- finalNewText = fullPrefix + finalNewText;
- }
-
- int replacedLength = replaceRangeEnd - replaceRangeStart;
- m_styleText.replace(replaceRangeStart, replacedLength, finalNewText);
- *removedRange = SourceRange(replaceRangeStart, replaceRangeEnd);
- *insertedLength = finalNewText.length();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleTextEditorh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorStyleTextEditor.h (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleTextEditor.h        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebCore/inspector/InspectorStyleTextEditor.h        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorStyleTextEditor_h
-#define InspectorStyleTextEditor_h
-
-#include "CSSPropertySourceData.h"
-
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-struct InspectorStyleProperty;
-struct SourceRange;
-
-typedef std::pair<String, String> NewLineAndWhitespace;
-
-class InspectorStyleTextEditor {
-public:
- InspectorStyleTextEditor(Vector<InspectorStyleProperty>* allProperties, Vector<InspectorStyleProperty>* disabledProperties, const String& styleText, const NewLineAndWhitespace& format);
- void insertProperty(unsigned index, const String& propertyText, unsigned styleBodyLength);
- void replaceProperty(unsigned index, const String& newText);
- void removeProperty(unsigned index);
- void enableProperty(unsigned index);
- void disableProperty(unsigned index);
- const String& styleText() const { return m_styleText; }
-
-private:
- unsigned disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent);
- void shiftDisabledProperties(unsigned fromIndex, long delta);
- void internalReplaceProperty(const InspectorStyleProperty&, const String& newText, SourceRange* removedRange, unsigned* insertedLength);
-
- Vector<InspectorStyleProperty>* m_allProperties;
- Vector<InspectorStyleProperty>* m_disabledProperties;
- String m_styleText;
- const std::pair<String, String> m_format;
-};
-
-} // namespace WebCore
-
-#endif // !defined(InspectorStyleTextEditor_h)
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2015-01-28 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
+ https://bugs.webkit.org/show_bug.cgi?id=140961
+
+ Reviewed by Timothy Hatcher.
+
+ Setters for CSSProperty (except override) are not used, so delete them. These setters
+ and their callees in DOMNodeStyles were the only clients of the removed protocol commands.
+
+ * UserInterface/Models/CSSProperty.js:
+ (WebInspector.CSSProperty.prototype.update):
+ (WebInspector.CSSProperty.prototype.get name):
+ (WebInspector.CSSProperty.prototype.get value):
+ (WebInspector.CSSProperty.prototype.get priority):
+ (WebInspector.CSSProperty.prototype.hasOtherVendorNameOrKeyword):
+ (WebInspector.CSSProperty.prototype.set text): Deleted.
+ (WebInspector.CSSProperty.prototype.set name): Deleted.
+ (WebInspector.CSSProperty.prototype.set value): Deleted.
+ (WebInspector.CSSProperty.prototype.set important): Deleted.
+ (WebInspector.CSSProperty.prototype.set priority): Deleted.
+ (WebInspector.CSSProperty.prototype.set enabled): Deleted.
+ (WebInspector.CSSProperty.prototype.add): Deleted.
+ (WebInspector.CSSProperty.prototype.remove): Deleted.
+ (WebInspector.CSSProperty.prototype._updatePropertySoon.performUpdate): Deleted.
+ (WebInspector.CSSProperty.prototype._updatePropertySoon): Deleted.
+ (WebInspector.CSSProperty.prototype._cancelPendingUpdate): Deleted.
+ * UserInterface/Models/CSSStyleDeclaration.js:
+ (WebInspector.CSSStyleDeclaration.prototype.addProperty): Deleted.
+ (WebInspector.CSSStyleDeclaration.prototype.removeProperty): Deleted.
+ * UserInterface/Models/DOMNodeStyles.js:
+ (WebInspector.DOMNodeStyles.prototype.addEmptyRule):
+ (WebInspector.DOMNodeStyles.prototype.addRule): Deleted.
+ (WebInspector.DOMNodeStyles.prototype.changeProperty): Deleted.
+ (WebInspector.DOMNodeStyles.prototype.changePropertyText): Deleted.
+ (WebInspector.DOMNodeStyles.prototype.changePropertyEnabledState): Deleted.
+ (WebInspector.DOMNodeStyles.prototype.addProperty): Deleted.
+ (WebInspector.DOMNodeStyles.prototype.removeProperty): Deleted.
+ (WebInspector.DOMNodeStyles.prototype._handlePropertyChange): Deleted.
+ * UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js:
+ * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
+ * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
+ * UserInterface/Views/RulesStyleDetailsPanel.js:
+ (WebInspector.RulesStyleDetailsPanel.prototype._newRuleClicked):
+ * Versions/Inspector-iOS-6.0.json:
+ * Versions/Inspector-iOS-7.0.json:
+ * Versions/Inspector-iOS-8.0.json:
+
</ins><span class="cx"> 2015-01-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSPropertyjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.CSSProperty.prototype = {
</span><span class="cx"> constructor: WebInspector.CSSProperty,
</span><ins>+ __proto__: WebInspector.Object.prototype,
</ins><span class="cx">
</span><span class="cx"> // Public
</span><span class="cx">
</span><span class="lines">@@ -113,12 +114,6 @@
</span><span class="cx"> delete this._canonicalName;
</span><span class="cx"> delete this._hasOtherVendorNameOrKeyword;
</span><span class="cx">
</span><del>- if (!this._updatePropertySoonTimeout) {
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
- }
-
</del><span class="cx"> if (changed)
</span><span class="cx"> this.dispatchEventToListeners(WebInspector.CSSProperty.Event.Changed);
</span><span class="cx"> },
</span><span class="lines">@@ -138,61 +133,11 @@
</span><span class="cx"> return this._text || this.synthesizedText;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set text(text)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._text === text)
- return;
-
- if (isNaN(this._index)) {
- this._text = text || "";
-
- // Clear the name, value and priority since they might not match the text now.
- this._name = "";
- this._value = "";
- this._priority = "";
-
- // Ditto for the canonical and pending properties.
- delete this._canonicalName;
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
-
- return;
- }
-
- this._cancelPendingUpdate();
- this._ownerStyle.nodeStyles.changePropertyText(this, text);
- },
-
</del><span class="cx"> get name()
</span><span class="cx"> {
</span><del>- if (isNaN(this._index))
- return this._pendingName || this._name;
</del><span class="cx"> return this._name;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set name(name)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._name === name)
- return;
-
- if (isNaN(this._index)) {
- this._name = name;
- this._text = "";
-
- delete this._canonicalName;
- } else {
- this._pendingName = name;
- this._updatePropertySoon();
- }
- },
-
</del><span class="cx"> get canonicalName()
</span><span class="cx"> {
</span><span class="cx"> if (this._canonicalName)
</span><span class="lines">@@ -205,75 +150,24 @@
</span><span class="cx">
</span><span class="cx"> get value()
</span><span class="cx"> {
</span><del>- if (isNaN(this._index))
- return this._pendingValue || this._value;
</del><span class="cx"> return this._value;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set value(value)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._value === value)
- return;
-
- if (isNaN(this._index)) {
- this._value = value;
- this._text = "";
- } else {
- this._pendingValue = value;
- this._updatePropertySoon();
- }
- },
-
</del><span class="cx"> get important()
</span><span class="cx"> {
</span><span class="cx"> return this.priority === "important";
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set important(important)
- {
- this.priority = important ? "important" : "";
- },
-
</del><span class="cx"> get priority()
</span><span class="cx"> {
</span><del>- if (isNaN(this._index))
- return this._pendingPriority || this._priority;
</del><span class="cx"> return this._priority;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set priority(priority)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._priority === priority)
- return;
-
- if (isNaN(this._index)) {
- this._priority = priority;
- this._text = "";
- } else {
- this._pendingPriority = priority;
- this._updatePropertySoon();
- }
- },
-
</del><span class="cx"> get enabled()
</span><span class="cx"> {
</span><span class="cx"> return this._enabled && this._ownerStyle && (!isNaN(this._index) || this._ownerStyle.type === WebInspector.CSSStyleDeclaration.Type.Computed);
</span><span class="cx"> },
</span><span class="cx">
</span><del>- set enabled(enabled)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- this._ownerStyle.nodeStyles.changePropertyEnabledState(this, enabled);
- },
-
</del><span class="cx"> get overridden()
</span><span class="cx"> {
</span><span class="cx"> return this._overridden;
</span><span class="lines">@@ -392,63 +286,5 @@
</span><span class="cx"> this._hasOtherVendorNameOrKeyword = WebInspector.cssStyleManager.propertyNameHasOtherVendorPrefix(this.name) || WebInspector.cssStyleManager.propertyValueHasOtherVendorKeyword(this.value);
</span><span class="cx">
</span><span class="cx"> return this._hasOtherVendorNameOrKeyword;
</span><del>- },
-
- add: function()
- {
- // We can only add if the index is NaN. Return early otherwise.
- if (!this._ownerStyle || !this._ownerStyle.editable || !isNaN(this._index))
- return;
-
- this._cancelPendingUpdate();
- this._ownerStyle.addProperty(this);
- },
-
- remove: function()
- {
- // We can only remove if the index is not NaN. Return early otherwise.
- if (!this._ownerStyle || !this._ownerStyle.editable || isNaN(this._index))
- return;
-
- this._cancelPendingUpdate();
- this._ownerStyle.removeProperty(this);
- },
-
- // Private
-
- _updatePropertySoon: function()
- {
- if (!this._ownerStyle || isNaN(this._index) || this._updatePropertySoonTimeout)
- return;
-
- function performUpdate()
- {
- delete this._updatePropertySoonTimeout;
-
- if (!this._ownerStyle || isNaN(this._index))
- return;
-
- var name = "_pendingName" in this ? this._pendingName : this._name;
- var value = "_pendingValue" in this ? this._pendingValue : this._value;
- var priority = "_pendingPriority" in this ? this._pendingPriority : this._priority;
-
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
-
- this._ownerStyle.nodeStyles.changeProperty(this, name, value, priority);
- }
-
- this._updatePropertySoonTimeout = setTimeout(performUpdate.bind(this), 0);
- },
-
- _cancelPendingUpdate: function()
- {
- if (!this._updatePropertySoonTimeout)
- return;
- clearTimeout(this._updatePropertySoonTimeout);
- delete this._updatePropertySoonTimeout;
</del><span class="cx"> }
</span><span class="cx"> };
</span><del>-
-WebInspector.CSSProperty.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.CSSStyleDeclaration.prototype = {
</span><span class="cx"> constructor: WebInspector.CSSStyleDeclaration,
</span><ins>+ __proto__: WebInspector.Object.prototype,
</ins><span class="cx">
</span><span class="cx"> // Public
</span><span class="cx">
</span><span class="lines">@@ -265,40 +266,6 @@
</span><span class="cx"> return newProperty;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- addProperty: function(property)
- {
- console.assert(property);
- if (!property)
- return;
-
- console.assert(property.ownerStyle === this);
- if (property.ownerStyle !== this)
- return;
-
- console.assert(this.editable);
- if (!this.editable)
- return;
-
- this._nodeStyles.addProperty(property);
- },
-
- removeProperty: function(property)
- {
- console.assert(property);
- if (!property)
- return;
-
- console.assert(property.ownerStyle === this);
- if (property.ownerStyle !== this)
- return;
-
- console.assert(this.editable);
- if (!this.editable)
- return;
-
- this._nodeStyles.removeProperty(property);
- },
-
</del><span class="cx"> // Protected
</span><span class="cx">
</span><span class="cx"> get nodeStyles()
</span><span class="lines">@@ -306,5 +273,3 @@
</span><span class="cx"> return this._nodeStyles;
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>-
-WebInspector.CSSStyleDeclaration.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -248,7 +248,7 @@
</span><span class="cx"> CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, fetchedComputedStyle.bind(this));
</span><span class="cx"> },
</span><span class="cx">
</span><del>- addRule: function(selector)
</del><ins>+ addEmptyRule: function()
</ins><span class="cx"> {
</span><span class="cx"> function addedRule(error, rulePayload)
</span><span class="cx"> {
</span><span class="lines">@@ -260,7 +260,7 @@
</span><span class="cx"> this.refresh();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- selector = selector || this._node.appropriateSelectorFor(true);
</del><ins>+ selector = this._node.appropriateSelectorFor(true);
</ins><span class="cx">
</span><span class="cx"> CSSAgent.addRule.invoke({contextNodeId: this._node.id, selector: selector}, addedRule.bind(this));
</span><span class="cx"> },
</span><span class="lines">@@ -451,83 +451,8 @@
</span><span class="cx"> style.ownerStyleSheet.requestContent().then(fetchedStyleSheetContent.bind(this));
</span><span class="cx"> },
</span><span class="cx">
</span><del>- changeProperty: function(property, name, value, priority)
- {
- var text = name ? name + ": " + value + (priority ? " !" + priority : "") + ";" : "";
- this.changePropertyText(property, text);
- },
-
- changePropertyText: function(property, text)
- {
- text = text || "";
-
- var index = property.index;
- var newProperty = isNaN(index);
- var overwrite = true;
-
- // If this is a new property, then give it an index at the end of the current properties.
- // Also don't overwrite, which will cause the property to be added at that index.
- if (newProperty) {
- index = property.ownerStyle.properties.length;
- overwrite = false;
- }
-
- if (text && text.charAt(text.length - 1) !== ";")
- text += ";";
-
- this._needsRefresh = true;
- this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
-
- CSSAgent.setPropertyText(property.ownerStyle.id, index, text, overwrite, this._handlePropertyChange.bind(this, property));
- },
-
- changePropertyEnabledState: function(property, enabled)
- {
- enabled = !!enabled;
-
- // Can't change a pending property with a NaN index.
- if (isNaN(property.index))
- return;
-
- this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
-
- CSSAgent.toggleProperty(property.ownerStyle.id, property.index, !enabled, this._handlePropertyChange.bind(this, property));
- },
-
- addProperty: function(property)
- {
- // Can't add a property unless it has a NaN index.
- if (!isNaN(property.index))
- return;
-
- // Adding is done by setting the text.
- this.changePropertyText(property, property.text);
- },
-
- removeProperty: function(property)
- {
- // Can't remove a pending property with a NaN index.
- if (isNaN(property.index))
- return;
-
- // Removing is done by setting text to an empty string.
- this.changePropertyText(property, "");
- },
-
</del><span class="cx"> // Private
</span><span class="cx">
</span><del>- _handlePropertyChange: function(property, error, stylePayload)
- {
- if (error)
- return;
-
- DOMAgent.markUndoableState();
-
- // Do a refresh instead of handling stylePayload so computed style is updated and we get valid
- // styleSheetTextRange values for all the rules after this change.
- this.refresh();
- },
-
</del><span class="cx"> _createSourceCodeLocation: function(sourceURL, sourceLine, sourceColumn)
</span><span class="cx"> {
</span><span class="cx"> if (!sourceURL)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLegacy60InspectorBackendCommandsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -209,8 +209,6 @@
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getStyleSheet", [{"name": "styleSheetId", "type": "string", "optional": false}], ["styleSheet"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}], ["text"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.setStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}, {"name": "text", "type": "string", "optional": false}], []);
</span><del>-InspectorBackend.registerCommand("CSS.setPropertyText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "overwrite", "type": "boolean", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.toggleProperty", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "disable", "type": "boolean", "optional": false}], ["style"]);
</del><span class="cx"> InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "type": "object", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLegacy70InspectorBackendCommandsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -238,8 +238,6 @@
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}], ["text"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.setStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}, {"name": "text", "type": "string", "optional": false}], []);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.setStyleText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "text", "type": "string", "optional": false}], ["style"]);
</span><del>-InspectorBackend.registerCommand("CSS.setPropertyText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "overwrite", "type": "boolean", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.toggleProperty", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "disable", "type": "boolean", "optional": false}], ["style"]);
</del><span class="cx"> InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "type": "object", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLegacy80InspectorBackendCommandsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -154,8 +154,6 @@
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}], ["text"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.setStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}, {"name": "text", "type": "string", "optional": false}], []);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.setStyleText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "text", "type": "string", "optional": false}], ["style"]);
</span><del>-InspectorBackend.registerCommand("CSS.setPropertyText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "overwrite", "type": "boolean", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.toggleProperty", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "disable", "type": "boolean", "optional": false}], ["style"]);
</del><span class="cx"> InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "type": "object", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
</span><span class="cx"> InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx"> _newRuleClicked: function(event)
</span><span class="cx"> {
</span><span class="cx"> this._focusNextNewInspectorRule = true;
</span><del>- this.nodeStyles.addRule();
</del><ins>+ this.nodeStyles.addEmptyRule();
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIVersionsInspectoriOS60json"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1731,31 +1731,6 @@
</span><span class="cx"> "description": "Sets the new stylesheet text, thereby invalidating all existing <code>CSSStyleId</code>'s and <code>CSSRuleId</code>'s contained by this stylesheet."
</span><span class="cx"> },
</span><span class="cx"> {
</span><del>- "name": "setPropertyText",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "text", "type": "string" },
- { "name": "overwrite", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property text modification." }
- ],
- "description": "Sets the new <code>text</code> for a property in the respective style, at offset <code>propertyIndex</code>. If <code>overwrite</code> is <code>true</code>, a property at the given offset is overwritten, otherwise inserted. <code>text</code> entirely replaces the property <code>name: value</code>."
- },
- {
- "name": "toggleProperty",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "disable", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property toggling." }
- ],
- "description": "Toggles the property in the respective style, at offset <code>propertyIndex</code>. The <code>disable</code> parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If <code>disable == false</code>, the property gets put back into its original place in the style declaration."
- },
- {
</del><span class="cx"> "name": "setRuleSelector",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "ruleId", "$ref": "CSSRuleId" },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIVersionsInspectoriOS70json"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -2032,31 +2032,6 @@
</span><span class="cx"> "description": "Sets the new <code>text</code> for the respective style."
</span><span class="cx"> },
</span><span class="cx"> {
</span><del>- "name": "setPropertyText",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "text", "type": "string" },
- { "name": "overwrite", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property text modification." }
- ],
- "description": "Sets the new <code>text</code> for a property in the respective style, at offset <code>propertyIndex</code>. If <code>overwrite</code> is <code>true</code>, a property at the given offset is overwritten, otherwise inserted. <code>text</code> entirely replaces the property <code>name: value</code>."
- },
- {
- "name": "toggleProperty",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "disable", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property toggling." }
- ],
- "description": "Toggles the property in the respective style, at offset <code>propertyIndex</code>. The <code>disable</code> parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If <code>disable == false</code>, the property gets put back into its original place in the style declaration."
- },
- {
</del><span class="cx"> "name": "setRuleSelector",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "ruleId", "$ref": "CSSRuleId" },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIVersionsInspectoriOS80json"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json (179285 => 179286)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json        2015-01-28 21:39:26 UTC (rev 179285)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json        2015-01-28 21:45:00 UTC (rev 179286)
</span><span class="lines">@@ -1173,31 +1173,6 @@
</span><span class="cx"> "description": "Sets the new <code>text</code> for the respective style."
</span><span class="cx"> },
</span><span class="cx"> {
</span><del>- "name": "setPropertyText",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "text", "type": "string" },
- { "name": "overwrite", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property text modification." }
- ],
- "description": "Sets the new <code>text</code> for a property in the respective style, at offset <code>propertyIndex</code>. If <code>overwrite</code> is <code>true</code>, a property at the given offset is overwritten, otherwise inserted. <code>text</code> entirely replaces the property <code>name: value</code>."
- },
- {
- "name": "toggleProperty",
- "parameters": [
- { "name": "styleId", "$ref": "CSSStyleId" },
- { "name": "propertyIndex", "type": "integer" },
- { "name": "disable", "type": "boolean" }
- ],
- "returns": [
- { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the property toggling." }
- ],
- "description": "Toggles the property in the respective style, at offset <code>propertyIndex</code>. The <code>disable</code> parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If <code>disable == false</code>, the property gets put back into its original place in the style declaration."
- },
- {
</del><span class="cx"> "name": "setRuleSelector",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "ruleId", "$ref": "CSSRuleId" },
</span></span></pre>
</div>
</div>
</body>
</html>