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
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated)
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Alexander Pavlov (apavlov)
:
Depends on: 98520
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-03 02:42 PDT by Alexander Pavlov (apavlov)
Modified: 2012-10-06 10:42 PDT (History)
15 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2012-10-03 02:42:23 PDT
For some broken stylesheets, CSSParser produces source data inconsistent with the resulting CSSOM.
Comment 1 Alexander Pavlov (apavlov) 2012-10-03 03:10:40 PDT
Created attachment 166843 [details]
Patch
Comment 2 Alexander Pavlov (apavlov) 2012-10-04 05:50:32 PDT
Created attachment 167084 [details]
Patch
Comment 3 Vsevolod Vlasov 2012-10-05 03:12:32 PDT
Comment on attachment 167084 [details]
Patch

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 Alexander Pavlov (apavlov) 2012-10-05 03:39:04 PDT
Created attachment 167301 [details]
Patch
Comment 5 Alexander Pavlov (apavlov) 2012-10-05 06:20:09 PDT
Created attachment 167317 [details]
Patch
Comment 6 Alexander Pavlov (apavlov) 2012-10-05 07:43:14 PDT
Created attachment 167327 [details]
Patch
Comment 7 Vsevolod Vlasov 2012-10-05 08:16:14 PDT
Comment on attachment 167327 [details]
Patch

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 Vsevolod Vlasov 2012-10-05 08:16:47 PDT
Comment on attachment 167327 [details]
Patch

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 Alexander Pavlov (apavlov) 2012-10-05 08:20:27 PDT
Created attachment 167330 [details]
Patch
Comment 10 Alexander Pavlov (apavlov) 2012-10-05 09:00:41 PDT
Committed r130511: <http://trac.webkit.org/changeset/130511>
Comment 11 Binyamin 2012-10-06 10:42:06 PDT
Related Chrome bug http://code.google.com/p/chromium/issues/detail?id=152636