| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 result.append(InspectorStyleProperty(CSSPropertySourceData(name, value,
!m_style->getPropertyPriority(name).isEmpty(), false, true, SourceRange()), fals
e)); | 667 result.append(InspectorStyleProperty(CSSPropertySourceData(name, value,
!m_style->getPropertyPriority(name).isEmpty(), false, true, SourceRange()), fals
e)); |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 | 670 |
| 671 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con
st | 671 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con
st |
| 672 { | 672 { |
| 673 RefPtr<Array<TypeBuilder::CSS::CSSProperty> > propertiesObject = Array<TypeB
uilder::CSS::CSSProperty>::create(); | 673 RefPtr<Array<TypeBuilder::CSS::CSSProperty> > propertiesObject = Array<TypeB
uilder::CSS::CSSProperty>::create(); |
| 674 RefPtr<Array<TypeBuilder::CSS::ShorthandEntry> > shorthandEntries = Array<Ty
peBuilder::CSS::ShorthandEntry>::create(); | 674 RefPtr<Array<TypeBuilder::CSS::ShorthandEntry> > shorthandEntries = Array<Ty
peBuilder::CSS::ShorthandEntry>::create(); |
| 675 HashSet<String> foundShorthands; | 675 HashSet<String> foundShorthands; |
| 676 OwnPtr<Vector<unsigned> > lineEndings(m_parentStyleSheet ? m_parentStyleShee
t->lineEndings() : PassOwnPtr<Vector<unsigned> >()); | 676 OwnPtr<Vector<unsigned> > lineEndings(m_parentStyleSheet ? m_parentStyleShee
t->lineEndings() : PassOwnPtr<Vector<unsigned> >()); |
| 677 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = extractSourceData(); |
| 677 | 678 |
| 678 WillBeHeapVector<InspectorStyleProperty> properties; | 679 WillBeHeapVector<InspectorStyleProperty> properties; |
| 679 populateAllProperties(properties); | 680 populateAllProperties(properties); |
| 680 | 681 |
| 681 for (WillBeHeapVector<InspectorStyleProperty>::iterator it = properties.begi
n(), itEnd = properties.end(); it != itEnd; ++it) { | 682 for (WillBeHeapVector<InspectorStyleProperty>::iterator it = properties.begi
n(), itEnd = properties.end(); it != itEnd; ++it) { |
| 682 const CSSPropertySourceData& propertyEntry = it->sourceData; | 683 const CSSPropertySourceData& propertyEntry = it->sourceData; |
| 683 const String& name = propertyEntry.name; | 684 const String& name = propertyEntry.name; |
| 684 | 685 |
| 685 RefPtr<TypeBuilder::CSS::CSSProperty> property = TypeBuilder::CSS::CSSPr
operty::create() | 686 RefPtr<TypeBuilder::CSS::CSSProperty> property = TypeBuilder::CSS::CSSPr
operty::create() |
| 686 .setName(name) | 687 .setName(name) |
| 687 .setValue(propertyEntry.value); | 688 .setValue(propertyEntry.value); |
| 688 propertiesObject->addItem(property); | 689 propertiesObject->addItem(property); |
| 689 | 690 |
| 690 // Default "parsedOk" == true. | 691 // Default "parsedOk" == true. |
| 691 if (!propertyEntry.parsedOk) | 692 if (!propertyEntry.parsedOk) |
| 692 property->setParsedOk(false); | 693 property->setParsedOk(false); |
| 693 if (it->hasRawText()) | 694 if (it->hasRawText()) |
| 694 property->setText(it->rawText); | 695 property->setText(it->rawText); |
| 695 | 696 |
| 696 if (propertyEntry.important) | 697 if (propertyEntry.important) |
| 697 property->setImportant(true); | 698 property->setImportant(true); |
| 698 if (it->hasSource) { | 699 if (it->hasSource) { |
| 699 property->setRange(buildSourceRangeObject(propertyEntry.range, lineE
ndings.get())); | 700 property->setRange(buildSourceRangeObject(propertyEntry.range, lineE
ndings.get())); |
| 700 if (!propertyEntry.disabled) | 701 if (!propertyEntry.disabled) { |
| 702 ASSERT_UNUSED(sourceData, sourceData); |
| 701 property->setImplicit(false); | 703 property->setImplicit(false); |
| 704 } |
| 702 property->setDisabled(propertyEntry.disabled); | 705 property->setDisabled(propertyEntry.disabled); |
| 703 } else if (!propertyEntry.disabled) { | 706 } else if (!propertyEntry.disabled) { |
| 704 bool implicit = m_style->isPropertyImplicit(name); | 707 bool implicit = m_style->isPropertyImplicit(name); |
| 705 // Default "implicit" == false. | 708 // Default "implicit" == false. |
| 706 if (implicit) | 709 if (implicit) |
| 707 property->setImplicit(true); | 710 property->setImplicit(true); |
| 708 | 711 |
| 709 String shorthand = m_style->getPropertyShorthand(name); | 712 String shorthand = m_style->getPropertyShorthand(name); |
| 710 if (!shorthand.isEmpty()) { | 713 if (!shorthand.isEmpty()) { |
| 711 if (foundShorthands.add(shorthand).isNewEntry) { | 714 if (foundShorthands.add(shorthand).isNewEntry) { |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 void InspectorStyleSheetForInlineStyle::trace(Visitor* visitor) | 1819 void InspectorStyleSheetForInlineStyle::trace(Visitor* visitor) |
| 1817 { | 1820 { |
| 1818 visitor->trace(m_element); | 1821 visitor->trace(m_element); |
| 1819 visitor->trace(m_ruleSourceData); | 1822 visitor->trace(m_ruleSourceData); |
| 1820 visitor->trace(m_inspectorStyle); | 1823 visitor->trace(m_inspectorStyle); |
| 1821 InspectorStyleSheetBase::trace(visitor); | 1824 InspectorStyleSheetBase::trace(visitor); |
| 1822 } | 1825 } |
| 1823 | 1826 |
| 1824 } // namespace blink | 1827 } // namespace blink |
| 1825 | 1828 |
| OLD | NEW |