OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } | 852 } |
853 | 853 |
854 void InspectorStyleSheetBase::fireStyleSheetChanged() | 854 void InspectorStyleSheetBase::fireStyleSheetChanged() |
855 { | 855 { |
856 if (listener()) | 856 if (listener()) |
857 listener()->styleSheetChanged(this); | 857 listener()->styleSheetChanged(this); |
858 } | 858 } |
859 | 859 |
860 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyleSheetBase::buildObjectForSt
yle(CSSStyleDeclaration* style) | 860 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyleSheetBase::buildObjectForSt
yle(CSSStyleDeclaration* style) |
861 { | 861 { |
862 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData; | 862 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = nullptr; |
863 if (ensureParsedDataReady()) | 863 if (ensureParsedDataReady()) |
864 sourceData = ruleSourceDataFor(style); | 864 sourceData = ruleSourceDataFor(style); |
865 | 865 |
866 InspectorCSSId id = styleId(style); | 866 InspectorCSSId id = styleId(style); |
867 if (id.isEmpty()) { | 867 if (id.isEmpty()) { |
868 // Any rule coming from User Agent and not from DefaultStyleSheet will n
ot have id. | 868 // Any rule coming from User Agent and not from DefaultStyleSheet will n
ot have id. |
869 // See InspectorCSSAgent::buildObjectForRule for details. | 869 // See InspectorCSSAgent::buildObjectForRule for details. |
870 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(id, style
, this); | 870 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(id, style
, this); |
871 return inspectorStyle->buildObjectForStyle(); | 871 return inspectorStyle->buildObjectForStyle(); |
872 } | 872 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 RefPtr<TypeBuilder::CSS::Selector> simpleSelector = TypeBuilder::CSS::Se
lector::create() | 1130 RefPtr<TypeBuilder::CSS::Selector> simpleSelector = TypeBuilder::CSS::Se
lector::create() |
1131 .setValue(selector.stripWhiteSpace()); | 1131 .setValue(selector.stripWhiteSpace()); |
1132 simpleSelector->setRange(buildSourceRangeObject(range, lineEndings().get
())); | 1132 simpleSelector->setRange(buildSourceRangeObject(range, lineEndings().get
())); |
1133 result->addItem(simpleSelector.release()); | 1133 result->addItem(simpleSelector.release()); |
1134 } | 1134 } |
1135 return result.release(); | 1135 return result.release(); |
1136 } | 1136 } |
1137 | 1137 |
1138 PassRefPtr<TypeBuilder::CSS::SelectorList> InspectorStyleSheet::buildObjectForSe
lectorList(CSSStyleRule* rule) | 1138 PassRefPtr<TypeBuilder::CSS::SelectorList> InspectorStyleSheet::buildObjectForSe
lectorList(CSSStyleRule* rule) |
1139 { | 1139 { |
1140 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData; | 1140 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = nullptr; |
1141 if (ensureParsedDataReady()) | 1141 if (ensureParsedDataReady()) |
1142 sourceData = ruleSourceDataFor(rule->style()); | 1142 sourceData = ruleSourceDataFor(rule->style()); |
1143 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectors; | 1143 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectors; |
1144 | 1144 |
1145 // This intentionally does not rely on the source data to avoid catching the
trailing comments (before the declaration starting '{'). | 1145 // This intentionally does not rely on the source data to avoid catching the
trailing comments (before the declaration starting '{'). |
1146 String selectorText = rule->selectorText(); | 1146 String selectorText = rule->selectorText(); |
1147 | 1147 |
1148 if (sourceData) | 1148 if (sourceData) |
1149 selectors = selectorsFromSource(sourceData.get(), m_parsedStyleSheet->te
xt()); | 1149 selectors = selectorsFromSource(sourceData.get(), m_parsedStyleSheet->te
xt()); |
1150 else { | 1150 else { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 | 1594 |
1595 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr
opertySet::create(); | 1595 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr
opertySet::create(); |
1596 RuleSourceDataList ruleSourceDataResult; | 1596 RuleSourceDataList ruleSourceDataResult; |
1597 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet().contents(), &ruleSourceDataResult); | 1597 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet().contents(), &ruleSourceDataResult); |
1598 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar
ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen
tSheet().contents()); | 1598 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar
ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen
tSheet().contents()); |
1599 return ruleSourceDataResult.first().release(); | 1599 return ruleSourceDataResult.first().release(); |
1600 } | 1600 } |
1601 | 1601 |
1602 } // namespace WebCore | 1602 } // namespace WebCore |
1603 | 1603 |
OLD | NEW |