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..0b76b5be7c8f57a7dce00026a8271a66c0db44f3 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(unsigned lineNumber, unsigned columnNumber, unsigned* offset) const |
| +{ |
| + OwnPtr<Vector<unsigned> > endings = lineEndings(); |
| + if (lineNumber >= endings->size()) |
| + return false; |
| + TextPosition position(OrdinalNumber::fromZeroBasedInt(lineNumber), OrdinalNumber::fromZeroBasedInt(columnNumber)); |
| + *offset = position.toOffsetPosition(*endings).zeroBasedInt(); |
|
apavlov
2014/02/21 14:37:55
This should check for columnNumber-is-beyond-last-
lushnikov
2014/02/23 16:07:07
Added check that columnNumber is beyond the amount
|
| + return true; |
| +} |
| + |
| void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle) |
| { |
| if (m_isRevalidating) |