Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclar...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 22:37:34 +0000 (22:37 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 22:37:34 +0000 (22:37 +0000)
commit8df8902c1946ded03c504146c20c3ada91832b3a
treedd373937682241428cce6aabea7d5e67d55f3a42
parent72eb6883e0a136fc4e344468ee0c14f9d956af84
Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=170279
<rdar://problem/30200492>

Reviewed by David Hyatt.

Source/WebCore:

The SourceRange for a CSSPropertySourceData should be relative to the start
of the declaration body, not the start of the StyleSheetHandler’s parsed
text. This only affected the ranges of unparsed (parsedOK == false) properties
lacking a trailing semi-colon.

This patch doesn't change the behavior of InspectorStyleSheet other than
silencing an irksome assert, as String::substring does a safety check on
the passed in length.

* inspector/InspectorStyleSheet.cpp:
(WebCore::fixUnparsedProperties):

LayoutTests:

* inspector/css/getAllStyleSheets.html:
Add stylesheet with an "unparsed" property having no final semicolon.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/css/getAllStyleSheets.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorStyleSheet.cpp