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