WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
109340
Web Inspector: protocol should support setStyleText
https://bugs.webkit.org/show_bug.cgi?id=109340
Summary
Web Inspector: protocol should support setStyleText
Timothy Hatcher
Reported
Saturday, February 9, 2013 4:24:52 AM UTC
You should be able to edit a whole CSSStyleDeclaration (like you can in the CSSOM with the cssText property). Something like: { "name": "setStyleText", "parameters": [ { "name": "styleId", "$ref": "CSSStyleId" }, { "name": "text", "type": "string" }, ], "returns": [ { "name": "style", "$ref": "CSSStyle", "description": "The resulting style after the text modification." } ], "description": "Sets the new <code>text</code> for the respective style." }, I understand you can get this crudely by using getStyleSheetText, replace the range gotten from the CSSStyle, then call setStyleSheetText. But that is fairly heavy handed, and would cause a world update for all rules in that stylesheet instead of a single rule. Having this setStyleText call would allow features like free-form editing of inline styles or rules in the sidebar, instead of individual property editing.
Attachments
Patch
(22.03 KB, patch)
2013-04-18 06:28 PDT
,
Timothy Hatcher
no flags
Details
Formatted Diff
Diff
Patch
(22.04 KB, patch)
2013-04-18 14:53 PDT
,
Timothy Hatcher
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Timothy Hatcher
Comment 1
Thursday, April 18, 2013 1:30:59 PM UTC
I have a patch for this. Working on the test now.
Timothy Hatcher
Comment 2
Thursday, April 18, 2013 2:28:22 PM UTC
Created
attachment 198728
[details]
Patch
Benjamin Poulain
Comment 3
Thursday, April 18, 2013 9:51:33 PM UTC
Comment on
attachment 198728
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=198728&action=review
> Source/WebCore/inspector/InspectorCSSAgent.cpp:363 > + : InspectorCSSAgent::StyleSheetAction("SetStyleText", styleSheet)
-> ASCIILiteral("SetStyleText") :)
Timothy Hatcher
Comment 4
Thursday, April 18, 2013 10:53:38 PM UTC
Created
attachment 198767
[details]
Patch
Joseph Pecoraro
Comment 5
Friday, April 19, 2013 6:17:05 AM UTC
Comment on
attachment 198767
[details]
Patch Nice! r=me
WebKit Commit Bot
Comment 6
Friday, April 19, 2013 6:57:50 AM UTC
Comment on
attachment 198767
[details]
Patch Clearing flags on attachment: 198767 Committed
r148723
: <
http://trac.webkit.org/changeset/148723
>
WebKit Commit Bot
Comment 7
Friday, April 19, 2013 6:57:53 AM UTC
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug