Chromium Code Reviews| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { | 508 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { |
| 509 CSSValue* item = i.value(); | 509 CSSValue* item = i.value(); |
| 510 t |= *toCSSPrimitiveValue(item); | 510 t |= *toCSSPrimitiveValue(item); |
| 511 } | 511 } |
| 512 state.style()->setTextDecoration(t); | 512 state.style()->setTextDecoration(t); |
| 513 } | 513 } |
| 514 | 514 |
| 515 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState & state) | 515 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState & state) |
| 516 { | 516 { |
| 517 state.style()->setTextIndent(state.parentStyle()->textIndent()); | 517 state.style()->setTextIndent(state.parentStyle()->textIndent()); |
| 518 #if ENABLE(CSS3_TEXT) | 518 if (RuntimeEnabledFeatures::css3TextEnabled()) |
| 519 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); | 519 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); |
| 520 #endif | |
| 521 } | 520 } |
| 522 | 521 |
| 523 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState & state) | 522 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState & state) |
| 524 { | 523 { |
| 525 state.style()->setTextIndent(RenderStyle::initialTextIndent()); | 524 state.style()->setTextIndent(RenderStyle::initialTextIndent()); |
| 526 #if ENABLE(CSS3_TEXT) | 525 if (RuntimeEnabledFeatures::css3TextEnabled()) |
|
Julien - ping for review
2013/08/21 01:50:08
Again shouldn't be needed as we block each-line at
jaehun
2013/08/21 05:51:02
Done.
| |
| 527 state.style()->setTextIndentLine(RenderStyle::initialTextIndentLine()); | 526 state.style()->setTextIndentLine(RenderStyle::initialTextIndentLine()); |
| 528 #endif | |
| 529 } | 527 } |
| 530 | 528 |
| 531 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState& state, CSSValue* value) | 529 void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState& state, CSSValue* value) |
| 532 { | 530 { |
| 533 if (!value->isValueList()) | 531 if (!value->isValueList()) |
| 534 return; | 532 return; |
| 535 | 533 |
| 536 // [ <length> | <percentage> ] -webkit-each-line | 534 // [ <length> | <percentage> ] each-line |
| 537 // The order is guaranteed. See CSSParser::parseTextIndent. | 535 // The order is guaranteed. See CSSParser::parseTextIndent. |
| 538 // The second value, -webkit-each-line is handled only when CSS3_TEXT is ena bled. | 536 // The second value, each-line is handled only when css3TextEnabled() return s true. |
| 539 | 537 |
| 540 CSSValueList* valueList = toCSSValueList(value); | 538 CSSValueList* valueList = toCSSValueList(value); |
| 541 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWitho utBoundsCheck(0)); | 539 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWitho utBoundsCheck(0)); |
| 542 Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntege rConversion | PercentConversion>(state.style(), state.rootElementStyle(), state. style()->effectiveZoom()); | 540 Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntege rConversion | PercentConversion>(state.style(), state.rootElementStyle(), state. style()->effectiveZoom()); |
| 543 ASSERT(!lengthOrPercentageValue.isUndefined()); | 541 ASSERT(!lengthOrPercentageValue.isUndefined()); |
| 544 state.style()->setTextIndent(lengthOrPercentageValue); | 542 state.style()->setTextIndent(lengthOrPercentageValue); |
| 545 | 543 |
| 546 #if ENABLE(CSS3_TEXT) | 544 if (!RuntimeEnabledFeatures::css3TextEnabled()) |
|
Julien - ping for review
2013/08/21 01:50:08
You reject CSS 3 Text at parse time if the flag is
jaehun
2013/08/21 05:51:02
Removed.
| |
| 545 return; | |
| 546 | |
| 547 ASSERT(valueList->length() <= 2); | 547 ASSERT(valueList->length() <= 2); |
| 548 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); | 548 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); |
| 549 if (eachLineValue) { | 549 if (eachLineValue) { |
| 550 ASSERT(eachLineValue->getValueID() == CSSValueWebkitEachLine); | 550 ASSERT(eachLineValue->getValueID() == CSSValueEachLine); |
| 551 state.style()->setTextIndentLine(TextIndentEachLine); | 551 state.style()->setTextIndentLine(TextIndentEachLine); |
| 552 } else { | 552 } else |
| 553 state.style()->setTextIndentLine(TextIndentFirstLine); | 553 state.style()->setTextIndentLine(TextIndentFirstLine); |
| 554 } | |
| 555 #endif | |
| 556 } | 554 } |
| 557 | 555 |
| 558 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value) | 556 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value) |
| 559 { | 557 { |
| 560 if (!value->isPrimitiveValue()) | 558 if (!value->isPrimitiveValue()) |
| 561 return; | 559 return; |
| 562 | 560 |
| 563 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 561 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 564 | 562 |
| 565 if (primitiveValue->getValueID()) | 563 if (primitiveValue->getValueID()) |
| (...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2253 break; | 2251 break; |
| 2254 } | 2252 } |
| 2255 case CSSPropertyEnableBackground: | 2253 case CSSPropertyEnableBackground: |
| 2256 // Silently ignoring this property for now | 2254 // Silently ignoring this property for now |
| 2257 // http://bugs.webkit.org/show_bug.cgi?id=6022 | 2255 // http://bugs.webkit.org/show_bug.cgi?id=6022 |
| 2258 break; | 2256 break; |
| 2259 } | 2257 } |
| 2260 } | 2258 } |
| 2261 | 2259 |
| 2262 } // namespace WebCore | 2260 } // namespace WebCore |
| OLD | NEW |