OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 state.style()->setTextIndentType(ComputedStyle::initialTextIndentType()); | 467 state.style()->setTextIndentType(ComputedStyle::initialTextIndentType()); |
468 } | 468 } |
469 | 469 |
470 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, const CSSValue& value) | 470 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, const CSSValue& value) |
471 { | 471 { |
472 Length lengthOrPercentageValue; | 472 Length lengthOrPercentageValue; |
473 TextIndentLine textIndentLineValue = ComputedStyle::initialTextIndentLine(); | 473 TextIndentLine textIndentLineValue = ComputedStyle::initialTextIndentLine(); |
474 TextIndentType textIndentTypeValue = ComputedStyle::initialTextIndentType(); | 474 TextIndentType textIndentTypeValue = ComputedStyle::initialTextIndentType(); |
475 | 475 |
476 for (auto& listValue : toCSSValueList(value)) { | 476 for (auto& listValue : toCSSValueList(value)) { |
477 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(listValue.get())
; | 477 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(listValue.
get()); |
478 if (!primitiveValue->getValueID()) | 478 if (!primitiveValue->getValueID()) |
479 lengthOrPercentageValue = primitiveValue->convertToLength(state.cssT
oLengthConversionData()); | 479 lengthOrPercentageValue = primitiveValue->convertToLength(state.cssT
oLengthConversionData()); |
480 else if (primitiveValue->getValueID() == CSSValueEachLine) | 480 else if (primitiveValue->getValueID() == CSSValueEachLine) |
481 textIndentLineValue = TextIndentEachLine; | 481 textIndentLineValue = TextIndentEachLine; |
482 else if (primitiveValue->getValueID() == CSSValueHanging) | 482 else if (primitiveValue->getValueID() == CSSValueHanging) |
483 textIndentTypeValue = TextIndentHanging; | 483 textIndentTypeValue = TextIndentHanging; |
484 else | 484 else |
485 NOTREACHED(); | 485 NOTREACHED(); |
486 } | 486 } |
487 | 487 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 return; | 695 return; |
696 } | 696 } |
697 | 697 |
698 ContentData* firstContent = nullptr; | 698 ContentData* firstContent = nullptr; |
699 ContentData* prevContent = nullptr; | 699 ContentData* prevContent = nullptr; |
700 for (auto& item : toCSSValueList(value)) { | 700 for (auto& item : toCSSValueList(value)) { |
701 ContentData* nextContent = nullptr; | 701 ContentData* nextContent = nullptr; |
702 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is
ImageValue()) { | 702 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is
ImageValue()) { |
703 nextContent = ContentData::create(state.styleImage(CSSPropertyConten
t, *item)); | 703 nextContent = ContentData::create(state.styleImage(CSSPropertyConten
t, *item)); |
704 } else if (item->isCounterValue()) { | 704 } else if (item->isCounterValue()) { |
705 CSSCounterValue* counterValue = toCSSCounterValue(item.get()); | 705 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); |
706 EListStyleType listStyleType = NoneListStyle; | 706 EListStyleType listStyleType = NoneListStyle; |
707 CSSValueID listStyleIdent = counterValue->listStyle(); | 707 CSSValueID listStyleIdent = counterValue->listStyle(); |
708 if (listStyleIdent != CSSValueNone) | 708 if (listStyleIdent != CSSValueNone) |
709 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); | 709 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); |
710 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicS
tring(counterValue->identifier()), listStyleType, AtomicString(counterValue->sep
arator()))); | 710 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicS
tring(counterValue->identifier()), listStyleType, AtomicString(counterValue->sep
arator()))); |
711 nextContent = ContentData::create(std::move(counter)); | 711 nextContent = ContentData::create(std::move(counter)); |
712 } else if (item->isPrimitiveValue()) { | 712 } else if (item->isPrimitiveValue()) { |
713 QuoteType quoteType; | 713 QuoteType quoteType; |
714 switch (toCSSPrimitiveValue(*item).getValueID()) { | 714 switch (toCSSPrimitiveValue(*item).getValueID()) { |
715 default: | 715 default: |
716 NOTREACHED(); | 716 NOTREACHED(); |
717 case CSSValueOpenQuote: | 717 case CSSValueOpenQuote: |
718 quoteType = OPEN_QUOTE; | 718 quoteType = OPEN_QUOTE; |
719 break; | 719 break; |
720 case CSSValueCloseQuote: | 720 case CSSValueCloseQuote: |
721 quoteType = CLOSE_QUOTE; | 721 quoteType = CLOSE_QUOTE; |
722 break; | 722 break; |
723 case CSSValueNoOpenQuote: | 723 case CSSValueNoOpenQuote: |
724 quoteType = NO_OPEN_QUOTE; | 724 quoteType = NO_OPEN_QUOTE; |
725 break; | 725 break; |
726 case CSSValueNoCloseQuote: | 726 case CSSValueNoCloseQuote: |
727 quoteType = NO_CLOSE_QUOTE; | 727 quoteType = NO_CLOSE_QUOTE; |
728 break; | 728 break; |
729 } | 729 } |
730 nextContent = ContentData::create(quoteType); | 730 nextContent = ContentData::create(quoteType); |
731 } else { | 731 } else { |
732 String string; | 732 String string; |
733 if (item->isFunctionValue()) { | 733 if (item->isFunctionValue()) { |
734 CSSFunctionValue* functionValue = toCSSFunctionValue(item.get())
; | 734 const CSSFunctionValue* functionValue = toCSSFunctionValue(item.
get()); |
735 DCHECK_EQ(functionValue->functionType(), CSSValueAttr); | 735 DCHECK_EQ(functionValue->functionType(), CSSValueAttr); |
736 // FIXME: Can a namespace be specified for an attr(foo)? | 736 // FIXME: Can a namespace be specified for an attr(foo)? |
737 if (state.style()->styleType() == PseudoIdNone) | 737 if (state.style()->styleType() == PseudoIdNone) |
738 state.style()->setUnique(); | 738 state.style()->setUnique(); |
739 else | 739 else |
740 state.parentStyle()->setUnique(); | 740 state.parentStyle()->setUnique(); |
741 QualifiedName attr(nullAtom, AtomicString(toCSSCustomIdentValue(
functionValue->item(0))->value()), nullAtom); | 741 QualifiedName attr(nullAtom, AtomicString(toCSSCustomIdentValue(
functionValue->item(0))->value()), nullAtom); |
742 const AtomicString& value = state.element()->getAttribute(attr); | 742 const AtomicString& value = state.element()->getAttribute(attr); |
743 string = value.isNull() ? emptyString() : value.getString(); | 743 string = value.isNull() ? emptyString() : value.getString(); |
744 } else { | 744 } else { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 } | 871 } |
872 } | 872 } |
873 | 873 |
874 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) | 874 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) |
875 { | 875 { |
876 if (!state.parentNode()->isDocumentNode()) | 876 if (!state.parentNode()->isDocumentNode()) |
877 state.style()->setPosition(state.parentStyle()->position()); | 877 state.style()->setPosition(state.parentStyle()->position()); |
878 } | 878 } |
879 | 879 |
880 } // namespace blink | 880 } // namespace blink |
OLD | NEW |