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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 toCSSIdentifierValue(value).getValueID() != CSSValueWebkitMatchParent) { | 468 toCSSIdentifierValue(value).getValueID() != CSSValueWebkitMatchParent) { |
469 // Special case for th elements - UA stylesheet text-align does not apply if | 469 // Special case for th elements - UA stylesheet text-align does not apply if |
470 // parent's computed value for text-align is not its initial value | 470 // parent's computed value for text-align is not its initial value |
471 // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 | 471 // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 |
472 const CSSIdentifierValue& identValue = toCSSIdentifierValue(value); | 472 const CSSIdentifierValue& identValue = toCSSIdentifierValue(value); |
473 if (identValue.getValueID() == CSSValueInternalCenter && | 473 if (identValue.getValueID() == CSSValueInternalCenter && |
474 state.parentStyle()->textAlign() != ComputedStyle::initialTextAlign()) | 474 state.parentStyle()->textAlign() != ComputedStyle::initialTextAlign()) |
475 state.style()->setTextAlign(state.parentStyle()->textAlign()); | 475 state.style()->setTextAlign(state.parentStyle()->textAlign()); |
476 else | 476 else |
477 state.style()->setTextAlign(identValue.convertTo<ETextAlign>()); | 477 state.style()->setTextAlign(identValue.convertTo<ETextAlign>()); |
478 } else if (state.parentStyle()->textAlign() == ETextAlign::Start) { | 478 } else if (state.parentStyle()->textAlign() == ETextAlign::kStart) { |
479 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() | 479 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() |
480 ? ETextAlign::Left | 480 ? ETextAlign::kLeft |
481 : ETextAlign::Right); | 481 : ETextAlign::kRight); |
482 } else if (state.parentStyle()->textAlign() == ETextAlign::End) { | 482 } else if (state.parentStyle()->textAlign() == ETextAlign::kEnd) { |
483 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() | 483 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection() |
484 ? ETextAlign::Right | 484 ? ETextAlign::kRight |
485 : ETextAlign::Left); | 485 : ETextAlign::kLeft); |
486 } else { | 486 } else { |
487 state.style()->setTextAlign(state.parentStyle()->textAlign()); | 487 state.style()->setTextAlign(state.parentStyle()->textAlign()); |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent( | 491 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent( |
492 StyleResolverState& state) { | 492 StyleResolverState& state) { |
493 state.style()->setTextIndent(state.parentStyle()->textIndent()); | 493 state.style()->setTextIndent(state.parentStyle()->textIndent()); |
494 state.style()->setTextIndentLine(state.parentStyle()->getTextIndentLine()); | 494 state.style()->setTextIndentLine(state.parentStyle()->getTextIndentLine()); |
495 state.style()->setTextIndentType(state.parentStyle()->getTextIndentType()); | 495 state.style()->setTextIndentType(state.parentStyle()->getTextIndentType()); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 ContentData* firstContent = nullptr; | 751 ContentData* firstContent = nullptr; |
752 ContentData* prevContent = nullptr; | 752 ContentData* prevContent = nullptr; |
753 for (auto& item : toCSSValueList(value)) { | 753 for (auto& item : toCSSValueList(value)) { |
754 ContentData* nextContent = nullptr; | 754 ContentData* nextContent = nullptr; |
755 if (item->isImageGeneratorValue() || item->isImageSetValue() || | 755 if (item->isImageGeneratorValue() || item->isImageSetValue() || |
756 item->isImageValue()) { | 756 item->isImageValue()) { |
757 nextContent = | 757 nextContent = |
758 ContentData::create(state.styleImage(CSSPropertyContent, *item)); | 758 ContentData::create(state.styleImage(CSSPropertyContent, *item)); |
759 } else if (item->isCounterValue()) { | 759 } else if (item->isCounterValue()) { |
760 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); | 760 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); |
761 EListStyleType listStyleType = EListStyleType::None; | 761 EListStyleType listStyleType = EListStyleType::kNone; |
762 CSSValueID listStyleIdent = counterValue->listStyle(); | 762 CSSValueID listStyleIdent = counterValue->listStyle(); |
763 if (listStyleIdent != CSSValueNone) | 763 if (listStyleIdent != CSSValueNone) |
764 listStyleType = | 764 listStyleType = |
765 static_cast<EListStyleType>(listStyleIdent - CSSValueDisc); | 765 static_cast<EListStyleType>(listStyleIdent - CSSValueDisc); |
766 std::unique_ptr<CounterContent> counter = | 766 std::unique_ptr<CounterContent> counter = |
767 WTF::wrapUnique(new CounterContent( | 767 WTF::wrapUnique(new CounterContent( |
768 AtomicString(counterValue->identifier()), listStyleType, | 768 AtomicString(counterValue->identifier()), listStyleType, |
769 AtomicString(counterValue->separator()))); | 769 AtomicString(counterValue->separator()))); |
770 nextContent = ContentData::create(std::move(counter)); | 770 nextContent = ContentData::create(std::move(counter)); |
771 } else if (item->isIdentifierValue()) { | 771 } else if (item->isIdentifierValue()) { |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 state.style()->setCaretColor( | 1033 state.style()->setCaretColor( |
1034 StyleBuilderConverter::convertStyleAutoColor(state, value)); | 1034 StyleBuilderConverter::convertStyleAutoColor(state, value)); |
1035 } | 1035 } |
1036 if (state.applyPropertyToVisitedLinkStyle()) { | 1036 if (state.applyPropertyToVisitedLinkStyle()) { |
1037 state.style()->setVisitedLinkCaretColor( | 1037 state.style()->setVisitedLinkCaretColor( |
1038 StyleBuilderConverter::convertStyleAutoColor(state, value, true)); | 1038 StyleBuilderConverter::convertStyleAutoColor(state, value, true)); |
1039 } | 1039 } |
1040 } | 1040 } |
1041 | 1041 |
1042 } // namespace blink | 1042 } // namespace blink |
OLD | NEW |