| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 , m_parentStyleSheet(parentStyleSheet) | 515 , m_parentStyleSheet(parentStyleSheet) |
| 516 , m_formatAcquired(false) | 516 , m_formatAcquired(false) |
| 517 { | 517 { |
| 518 ASSERT(m_style); | 518 ASSERT(m_style); |
| 519 } | 519 } |
| 520 | 520 |
| 521 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::buildObjectForStyle() con
st | 521 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::buildObjectForStyle() con
st |
| 522 { | 522 { |
| 523 RefPtr<TypeBuilder::CSS::CSSStyle> result = styleWithProperties(); | 523 RefPtr<TypeBuilder::CSS::CSSStyle> result = styleWithProperties(); |
| 524 if (!m_styleId.isEmpty()) | 524 if (!m_styleId.isEmpty()) |
| 525 result->setStyleId(m_styleId.asProtocolValue<TypeBuilder::CSS::CSSStyleI
d>()); | 525 result->setStyleSheetId(m_styleId.styleSheetId()); |
| 526 | 526 |
| 527 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = extractSourceData(); | 527 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = extractSourceData(); |
| 528 if (sourceData) | 528 if (sourceData) |
| 529 result->setRange(buildSourceRangeObject(sourceData->ruleBodyRange, m_par
entStyleSheet->lineEndings().get())); | 529 result->setRange(buildSourceRangeObject(sourceData->ruleBodyRange, m_par
entStyleSheet->lineEndings().get())); |
| 530 | 530 |
| 531 return result.release(); | 531 return result.release(); |
| 532 } | 532 } |
| 533 | 533 |
| 534 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> > Insp
ectorStyle::buildArrayForComputedStyle() const | 534 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> > Insp
ectorStyle::buildArrayForComputedStyle() const |
| 535 { | 535 { |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 .setOrigin(m_origin) | 1228 .setOrigin(m_origin) |
| 1229 .setStyle(buildObjectForStyle(rule->style())); | 1229 .setStyle(buildObjectForStyle(rule->style())); |
| 1230 | 1230 |
| 1231 String url = this->url(); | 1231 String url = this->url(); |
| 1232 if (!url.isEmpty()) | 1232 if (!url.isEmpty()) |
| 1233 result->setSourceURL(url); | 1233 result->setSourceURL(url); |
| 1234 | 1234 |
| 1235 if (canBind(m_origin)) { | 1235 if (canBind(m_origin)) { |
| 1236 InspectorCSSId id(ruleId(rule)); | 1236 InspectorCSSId id(ruleId(rule)); |
| 1237 if (!id.isEmpty()) | 1237 if (!id.isEmpty()) |
| 1238 result->setRuleId(id.asProtocolValue<TypeBuilder::CSS::CSSRuleId>())
; | 1238 result->setStyleSheetId(id.styleSheetId()); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 if (mediaStack) | 1241 if (mediaStack) |
| 1242 result->setMedia(mediaStack); | 1242 result->setMedia(mediaStack); |
| 1243 | 1243 |
| 1244 return result.release(); | 1244 return result.release(); |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 bool InspectorStyleSheet::getText(String* result) const | 1247 bool InspectorStyleSheet::getText(String* result) const |
| 1248 { | 1248 { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 | 1667 |
| 1668 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr
opertySet::create(); | 1668 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr
opertySet::create(); |
| 1669 RuleSourceDataList ruleSourceDataResult; | 1669 RuleSourceDataList ruleSourceDataResult; |
| 1670 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet().contents(), &ruleSourceDataResult); | 1670 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet().contents(), &ruleSourceDataResult); |
| 1671 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar
ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen
tSheet().contents()); | 1671 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar
ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen
tSheet().contents()); |
| 1672 return ruleSourceDataResult.first().release(); | 1672 return ruleSourceDataResult.first().release(); |
| 1673 } | 1673 } |
| 1674 | 1674 |
| 1675 } // namespace WebCore | 1675 } // namespace WebCore |
| 1676 | 1676 |
| OLD | NEW |