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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPointTearOff.cpp

Issue 2912663002: Clean up creation of "detached" SVG* data type objects (Closed)
Patch Set: Created 3 years, 6 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (IsImmutable()) { 57 if (IsImmutable()) {
58 ThrowReadOnly(exception_state); 58 ThrowReadOnly(exception_state);
59 return; 59 return;
60 } 60 }
61 Target()->SetY(f); 61 Target()->SetY(f);
62 CommitChange(); 62 CommitChange();
63 } 63 }
64 64
65 SVGPointTearOff* SVGPointTearOff::matrixTransform(SVGMatrixTearOff* matrix) { 65 SVGPointTearOff* SVGPointTearOff::matrixTransform(SVGMatrixTearOff* matrix) {
66 FloatPoint point = Target()->MatrixTransform(matrix->Value()); 66 FloatPoint point = Target()->MatrixTransform(matrix->Value());
67 return SVGPointTearOff::Create(SVGPoint::Create(point), 0, 67 return CreateDetached(point);
68 kPropertyIsNotAnimVal); 68 }
69
70 SVGPointTearOff* SVGPointTearOff::CreateDetached(const FloatPoint& point) {
71 return Create(SVGPoint::Create(point), nullptr, kPropertyIsNotAnimVal,
72 QualifiedName::Null());
69 } 73 }
70 74
71 DEFINE_TRACE_WRAPPERS(SVGPointTearOff) { 75 DEFINE_TRACE_WRAPPERS(SVGPointTearOff) {
72 visitor->TraceWrappers(contextElement()); 76 visitor->TraceWrappers(contextElement());
73 } 77 }
74 78
75 } // namespace blink 79 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698