Chromium Code Reviews| 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) |