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

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

Issue 547273002: Make currentColor behave the same internally as initial (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (!currValue->isPrimitiveValue()) 511 if (!currValue->isPrimitiveValue())
512 continue; 512 continue;
513 513
514 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i)); 514 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i));
515 array->append(SVGLength::fromCSSPrimitiveValue(dash)); 515 array->append(SVGLength::fromCSSPrimitiveValue(dash));
516 } 516 }
517 517
518 return array.release(); 518 return array.release();
519 } 519 }
520 520
521 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C SSValue* value, bool forVisitedLink)
522 {
523 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
524 if (primitiveValue->getValueID() == CSSValueCurrentcolor)
525 return StyleColor::currentColor();
526 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa lue, Color(), forVisitedLink);
527 }
528
521 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue * value) 529 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue * value)
522 { 530 {
523 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 531 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
524 if (primitiveValue->isRGBColor()) 532 if (primitiveValue->isRGBColor())
525 return primitiveValue->getRGBA32Value(); 533 return primitiveValue->getRGBA32Value();
526 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); 534 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor);
527 return state.style()->color(); 535 return state.style()->color();
528 } 536 }
529 537
530 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState &, CSSValue* value) 538 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState &, CSSValue* value)
531 { 539 {
532 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); 540 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value));
533 } 541 }
534 542
535 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value) 543 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value)
536 { 544 {
537 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 545 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
538 if (primitiveValue->getValueID()) { 546 if (primitiveValue->getValueID()) {
539 float multiplier = convertLineWidth<float>(state, value); 547 float multiplier = convertLineWidth<float>(state, value);
540 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData()); 548 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData());
541 } 549 }
542 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); 550 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( ));
543 } 551 }
544 552
545 } // namespace blink 553 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698