Changeset 112083 in webkit


Ignore:
Timestamp:
Mar 26, 2012 6:07:24 AM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [REGRESSION] Workarounds for security checks when retrieving stylesheet rule lists are broken
https://bugs.webkit.org/show_bug.cgi?id=82191

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Test: http/tests/inspector/modify-cross-domain-rule.html

  • inspector/InspectorStyleSheet.cpp:

(WebCore::asCSSRuleList):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet):

LayoutTests:

  • http/tests/inspector/modify-cross-domain-rule-expected.txt: Added.
  • http/tests/inspector/modify-cross-domain-rule.html: Added.
  • http/tests/inspector/styles/modify-cross-domain-rule.css: Added.

(#inspected):

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112079 r112083  
     12012-03-26  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [REGRESSION] Workarounds for security checks when retrieving stylesheet rule lists are broken
     4        https://bugs.webkit.org/show_bug.cgi?id=82191
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * http/tests/inspector/modify-cross-domain-rule-expected.txt: Added.
     9        * http/tests/inspector/modify-cross-domain-rule.html: Added.
     10        * http/tests/inspector/styles/modify-cross-domain-rule.css: Added.
     11        (#inspected):
     12
    1132012-03-26  Szilard Ledan  <szledan@inf.u-szeged.hu>
    214
  • trunk/Source/WebCore/ChangeLog

    r112082 r112083  
     12012-03-26  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [REGRESSION] Workarounds for security checks when retrieving stylesheet rule lists are broken
     4        https://bugs.webkit.org/show_bug.cgi?id=82191
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Test: http/tests/inspector/modify-cross-domain-rule.html
     9
     10        * inspector/InspectorStyleSheet.cpp:
     11        (WebCore::asCSSRuleList):
     12        (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
     13
    1142012-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r112076 r112083  
    154154        return 0;
    155155
    156     return styleSheet->cssRules();
     156    RefPtr<StaticCSSRuleList> list = StaticCSSRuleList::create();
     157    Vector<RefPtr<CSSRule> >& listRules = list->rules();
     158    for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
     159        CSSRule* item = styleSheet->item(i);
     160        if (item->isCharsetRule())
     161            continue;
     162        listRules.append(item);
     163    }
     164    return list.release();
    157165}
    158166
     
    836844    RefPtr<InspectorObject> result = InspectorObject::create();
    837845    result->setString("styleSheetId", id());
    838     RefPtr<CSSRuleList> cssRuleList = styleSheet->cssRules();
     846    RefPtr<CSSRuleList> cssRuleList = asCSSRuleList(styleSheet);
    839847    RefPtr<InspectorArray> cssRules = buildArrayForRuleList(cssRuleList.get());
    840848    result->setArray("rules", cssRules.release());
Note: See TracChangeset for help on using the changeset viewer.