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

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

Issue 1649003002: Use StylePath instead of (Path)StyleMotionPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "core/css/resolver/ElementStyleResources.h" 62 #include "core/css/resolver/ElementStyleResources.h"
63 #include "core/css/resolver/FilterOperationResolver.h" 63 #include "core/css/resolver/FilterOperationResolver.h"
64 #include "core/css/resolver/FontBuilder.h" 64 #include "core/css/resolver/FontBuilder.h"
65 #include "core/css/resolver/StyleBuilder.h" 65 #include "core/css/resolver/StyleBuilder.h"
66 #include "core/css/resolver/TransformBuilder.h" 66 #include "core/css/resolver/TransformBuilder.h"
67 #include "core/frame/LocalFrame.h" 67 #include "core/frame/LocalFrame.h"
68 #include "core/frame/Settings.h" 68 #include "core/frame/Settings.h"
69 #include "core/style/CounterContent.h" 69 #include "core/style/CounterContent.h"
70 #include "core/style/ComputedStyle.h" 70 #include "core/style/ComputedStyle.h"
71 #include "core/style/ComputedStyleConstants.h" 71 #include "core/style/ComputedStyleConstants.h"
72 #include "core/style/PathStyleMotionPath.h"
73 #include "core/style/QuotesData.h" 72 #include "core/style/QuotesData.h"
74 #include "core/style/SVGComputedStyle.h" 73 #include "core/style/SVGComputedStyle.h"
75 #include "core/style/StyleGeneratedImage.h" 74 #include "core/style/StyleGeneratedImage.h"
76 #include "core/style/StyleVariableData.h" 75 #include "core/style/StyleVariableData.h"
77 #include "platform/fonts/FontDescription.h" 76 #include "platform/fonts/FontDescription.h"
78 #include "wtf/MathExtras.h" 77 #include "wtf/MathExtras.h"
79 #include "wtf/StdLibExtras.h" 78 #include "wtf/StdLibExtras.h"
80 #include "wtf/Vector.h" 79 #include "wtf/Vector.h"
81 80
82 namespace blink { 81 namespace blink {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 425 }
427 426
428 void StyleBuilderFunctions::applyValueCSSPropertyTransform(StyleResolverState& s tate, CSSValue* value) 427 void StyleBuilderFunctions::applyValueCSSPropertyTransform(StyleResolverState& s tate, CSSValue* value)
429 { 428 {
430 // FIXME: We should just make this a converter 429 // FIXME: We should just make this a converter
431 TransformOperations operations; 430 TransformOperations operations;
432 TransformBuilder::createTransformOperations(*value, state.cssToLengthConvers ionData(), operations); 431 TransformBuilder::createTransformOperations(*value, state.cssToLengthConvers ionData(), operations);
433 state.style()->setTransform(operations); 432 state.style()->setTransform(operations);
434 } 433 }
435 434
436 void StyleBuilderFunctions::applyInheritCSSPropertyMotionPath(StyleResolverState & state)
437 {
438 if (state.parentStyle()->motionPath())
439 state.style()->setMotionPath(state.parentStyle()->motionPath());
440 else
441 state.style()->resetMotionPath();
442 }
443
444 void StyleBuilderFunctions::applyValueCSSPropertyMotionPath(StyleResolverState& state, CSSValue* value)
445 {
446 if (value->isPathValue()) {
447 const String& pathString = toCSSPathValue(value)->pathString();
448 state.style()->setMotionPath(PathStyleMotionPath::create(pathString));
449 return;
450 }
451
452 ASSERT(value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
453 state.style()->resetMotionPath();
454 }
455
456 void StyleBuilderFunctions::applyInitialCSSPropertyMotionPath(StyleResolverState & state)
457 {
458 state.style()->resetMotionPath();
459 }
460
461 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt ate& state) 435 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt ate& state)
462 { 436 {
463 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign(); 437 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign();
464 state.style()->setVerticalAlign(verticalAlign); 438 state.style()->setVerticalAlign(verticalAlign);
465 if (verticalAlign == LENGTH) 439 if (verticalAlign == LENGTH)
466 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign Length()); 440 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign Length());
467 } 441 }
468 442
469 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value) 443 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value)
470 { 444 {
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 return; 802 return;
829 case CSSValueSuper: 803 case CSSValueSuper:
830 svgStyle.setBaselineShift(BS_SUPER); 804 svgStyle.setBaselineShift(BS_SUPER);
831 return; 805 return;
832 default: 806 default:
833 ASSERT_NOT_REACHED(); 807 ASSERT_NOT_REACHED();
834 } 808 }
835 } 809 }
836 810
837 } // namespace blink 811 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698