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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { | 509 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { |
510 CSSValue* item = i.value(); | 510 CSSValue* item = i.value(); |
511 t |= *toCSSPrimitiveValue(item); | 511 t |= *toCSSPrimitiveValue(item); |
512 } | 512 } |
513 state.style()->setTextDecoration(t); | 513 state.style()->setTextDecoration(t); |
514 } | 514 } |
515 | 515 |
516 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState
& state) | 516 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState
& state) |
517 { | 517 { |
518 state.style()->setTextIndent(state.parentStyle()->textIndent()); | 518 state.style()->setTextIndent(state.parentStyle()->textIndent()); |
519 #if ENABLE(CSS3_TEXT) | |
520 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); | 519 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); |
521 #endif | |
522 } | 520 } |
523 | 521 |
524 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState
& state) | 522 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState
& state) |
525 { | 523 { |
526 state.style()->setTextIndent(RenderStyle::initialTextIndent()); | 524 state.style()->setTextIndent(RenderStyle::initialTextIndent()); |
527 #if ENABLE(CSS3_TEXT) | |
528 state.style()->setTextIndentLine(RenderStyle::initialTextIndentLine()); | 525 state.style()->setTextIndentLine(RenderStyle::initialTextIndentLine()); |
529 #endif | |
530 } | 526 } |
531 | 527 |
532 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, CSSValue* value) | 528 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState&
state, CSSValue* value) |
533 { | 529 { |
534 if (!value->isValueList()) | 530 if (!value->isValueList()) |
535 return; | 531 return; |
536 | 532 |
537 // [ <length> | <percentage> ] -webkit-each-line | 533 // [ <length> | <percentage> ] each-line |
538 // The order is guaranteed. See CSSParser::parseTextIndent. | 534 // The order is guaranteed. See CSSParser::parseTextIndent. |
539 // The second value, -webkit-each-line is handled only when CSS3_TEXT is ena
bled. | 535 // The second value, each-line is handled only when css3TextEnabled() return
s true. |
540 | 536 |
541 CSSValueList* valueList = toCSSValueList(value); | 537 CSSValueList* valueList = toCSSValueList(value); |
542 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWitho
utBoundsCheck(0)); | 538 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWitho
utBoundsCheck(0)); |
543 Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntege
rConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.
style()->effectiveZoom()); | 539 Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntege
rConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.
style()->effectiveZoom()); |
544 ASSERT(!lengthOrPercentageValue.isUndefined()); | 540 ASSERT(!lengthOrPercentageValue.isUndefined()); |
545 state.style()->setTextIndent(lengthOrPercentageValue); | 541 state.style()->setTextIndent(lengthOrPercentageValue); |
546 | 542 |
547 #if ENABLE(CSS3_TEXT) | |
548 ASSERT(valueList->length() <= 2); | 543 ASSERT(valueList->length() <= 2); |
549 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); | 544 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); |
550 if (eachLineValue) { | 545 if (eachLineValue) { |
551 ASSERT(eachLineValue->getValueID() == CSSValueWebkitEachLine); | 546 ASSERT(eachLineValue->getValueID() == CSSValueEachLine); |
552 state.style()->setTextIndentLine(TextIndentEachLine); | 547 state.style()->setTextIndentLine(TextIndentEachLine); |
553 } else { | 548 } else |
554 state.style()->setTextIndentLine(TextIndentFirstLine); | 549 state.style()->setTextIndentLine(TextIndentFirstLine); |
555 } | |
556 #endif | |
557 } | 550 } |
558 | 551 |
559 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat
e& state, CSSValue* value) | 552 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat
e& state, CSSValue* value) |
560 { | 553 { |
561 if (!value->isPrimitiveValue()) | 554 if (!value->isPrimitiveValue()) |
562 return; | 555 return; |
563 | 556 |
564 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 557 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
565 | 558 |
566 if (primitiveValue->getValueID()) | 559 if (primitiveValue->getValueID()) |
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2348 break; | 2341 break; |
2349 } | 2342 } |
2350 case CSSPropertyEnableBackground: | 2343 case CSSPropertyEnableBackground: |
2351 // Silently ignoring this property for now | 2344 // Silently ignoring this property for now |
2352 // http://bugs.webkit.org/show_bug.cgi?id=6022 | 2345 // http://bugs.webkit.org/show_bug.cgi?id=6022 |
2353 break; | 2346 break; |
2354 } | 2347 } |
2355 } | 2348 } |
2356 | 2349 |
2357 } // namespace WebCore | 2350 } // namespace WebCore |
OLD | NEW |