Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 172593003: DevTools: [CSS] Add CSS.editRangeInStyleSheetText() to the protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address @apavlov & @pfeldman comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorStyleSheet.h ('k') | Source/devtools/front_end/StylesSidebarPane.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 14911cfc3fb87695a7a01c144ddae10411eff95d..009be5dfb0eb0ad9806ff3c37adfc45b23cc52bb 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -1557,6 +1557,16 @@ InspectorCSSId InspectorStyleSheet::ruleId(CSSStyleRule* rule) const
return ruleOrStyleId(rule->style());
}
+bool InspectorStyleSheet::lineNumberAndColumnToOffset(int lineNumber, int columnNumber, unsigned* offset) const
apavlov 2014/02/20 14:21:24 int -> unsigned
lushnikov 2014/02/20 14:37:34 Done.
+{
+ OwnPtr<Vector<unsigned> > endings = lineEndings();
+ if (lineNumber < 0 || (size_t)lineNumber >= endings->size())
apavlov 2014/02/20 14:21:24 Use static_cast<unsigned>() in ICSSAgent
lushnikov 2014/02/20 14:37:34 Don't need this anymore
+ return false;
+ TextPosition position(OrdinalNumber::fromZeroBasedInt(lineNumber), OrdinalNumber::fromZeroBasedInt(columnNumber));
+ *offset = position.toOffsetPosition(*endings).zeroBasedInt();
+ return true;
+}
+
void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
{
if (m_isRevalidating)
« no previous file with comments | « Source/core/inspector/InspectorStyleSheet.h ('k') | Source/devtools/front_end/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698