Bug 98246 - Web Inspector: [Styles] Unable to edit properties in broken stylesheets
: Web Inspector: [Styles] Unable to edit properties in broken stylesheets
Status: RESOLVED FIXED
: WebKit
Web Inspector (Deprecated)
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
: 98520
:
  Show dependency treegraph
 
Reported: 2012-10-03 02:42 PST by
Modified: 2012-10-06 10:42 PST (History)


Attachments
Patch (17.23 KB, patch)
2012-10-03 03:10 PST, Alexander Pavlov (apavlov)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (22.64 KB, patch)
2012-10-04 05:50 PST, Alexander Pavlov (apavlov)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (21.50 KB, patch)
2012-10-05 03:39 PST, Alexander Pavlov (apavlov)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (18.64 KB, patch)
2012-10-05 06:20 PST, Alexander Pavlov (apavlov)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (19.51 KB, patch)
2012-10-05 07:43 PST, Alexander Pavlov (apavlov)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (17.46 KB, patch)
2012-10-05 08:20 PST, Alexander Pavlov (apavlov)
vsevik: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-10-03 02:42:23 PST
For some broken stylesheets, CSSParser produces source data inconsistent with the resulting CSSOM.
------- Comment #1 From 2012-10-03 03:10:40 PST -------
Created an attachment (id=166843) [details]
Patch
------- Comment #2 From 2012-10-04 05:50:32 PST -------
Created an attachment (id=167084) [details]
Patch
------- Comment #3 From 2012-10-05 03:12:32 PST -------
(From update of attachment 167084 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=167084&action=review

> Source/WebCore/css/CSSParser.cpp:10328
> +    if (!m_currentRuleData->isBlockRule() && m_currentRuleData->type != CSSRuleSourceData::IMPORT_RULE)

I don't think this condition is ever true.
------- Comment #4 From 2012-10-05 03:39:04 PST -------
Created an attachment (id=167301) [details]
Patch
------- Comment #5 From 2012-10-05 06:20:09 PST -------
Created an attachment (id=167317) [details]
Patch
------- Comment #6 From 2012-10-05 07:43:14 PST -------
Created an attachment (id=167327) [details]
Patch
------- Comment #7 From 2012-10-05 08:16:14 PST -------
(From update of attachment 167327 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=167327&action=review

> Source/WebCore/css/CSSParser.cpp:10300
> +        m_currentRuleData.clear();

Redundant

> Source/WebCore/css/CSSParser.cpp:10302
> +    m_currentRuleData = CSSRuleSourceData::create(ruleType);

Let's just add m_currentRuleData = data; above.

> Source/WebCore/css/CSSParser.cpp:-10382
> -        SourceRange& topRuleBodyRange = m_currentRuleDataStack->last()->ruleBodyRange;

Looks like a separate change.
------- Comment #8 From 2012-10-05 08:16:47 PST -------
(From update of attachment 167327 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=167327&action=review

> Source/WebCore/css/CSSParser.cpp:9929
> +        popRuleData();

This should be put into separate patch, you should also fix some similar issues with other types of rules.
------- Comment #9 From 2012-10-05 08:20:27 PST -------
Created an attachment (id=167330) [details]
Patch
------- Comment #10 From 2012-10-05 09:00:41 PST -------
Committed r130511: <http://trac.webkit.org/changeset/130511>
------- Comment #11 From 2012-10-06 10:42:06 PST -------
Related Chrome bug http://code.google.com/p/chromium/issues/detail?id=152636