Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 22336008: Use the runtime flag and remove '-webkit-' prefix for CSS3 text-indent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: patch Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
Julien - ping for review 2013/08/21 23:54:50 This ASSERT is still valid AFAICT so we should kee
jaehun 2013/08/22 02:04:39 Umm... I agree. I'll recover ASSERT.
549 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); 543 CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1));
550 if (eachLineValue) { 544 if (eachLineValue) {
551 ASSERT(eachLineValue->getValueID() == CSSValueWebkitEachLine); 545 ASSERT(eachLineValue->getValueID() == CSSValueEachLine);
552 state.style()->setTextIndentLine(TextIndentEachLine); 546 state.style()->setTextIndentLine(TextIndentEachLine);
553 } else { 547 } else
554 state.style()->setTextIndentLine(TextIndentFirstLine); 548 state.style()->setTextIndentLine(TextIndentFirstLine);
555 }
556 #endif
557 } 549 }
558 550
559 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value) 551 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value)
560 { 552 {
561 if (!value->isPrimitiveValue()) 553 if (!value->isPrimitiveValue())
562 return; 554 return;
563 555
564 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 556 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
565 557
566 if (primitiveValue->getValueID()) 558 if (primitiveValue->getValueID())
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 break; 2329 break;
2338 } 2330 }
2339 case CSSPropertyEnableBackground: 2331 case CSSPropertyEnableBackground:
2340 // Silently ignoring this property for now 2332 // Silently ignoring this property for now
2341 // http://bugs.webkit.org/show_bug.cgi?id=6022 2333 // http://bugs.webkit.org/show_bug.cgi?id=6022
2342 break; 2334 break;
2343 } 2335 }
2344 } 2336 }
2345 2337
2346 } // namespace WebCore 2338 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698