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

Side by Side Diff: sky/engine/core/rendering/style/RenderStyle.cpp

Issue 1076623002: Remove our impressive amount of CSS Cursor code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 diff.setTransformChanged(); 460 diff.setTransformChanged();
461 461
462 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity ) 462 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity )
463 diff.setOpacityChanged(); 463 diff.setOpacityChanged();
464 464
465 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt er) 465 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt er)
466 diff.setFilterChanged(); 466 diff.setFilterChanged();
467 } 467 }
468 } 468 }
469 469
470 void RenderStyle::addCursor(PassRefPtr<StyleImage> image, const IntPoint& hotSpo t)
471 {
472 if (!rareInheritedData.access()->cursorData)
473 rareInheritedData.access()->cursorData = CursorList::create();
474 rareInheritedData.access()->cursorData->append(CursorData(image, hotSpot));
475 }
476
477 void RenderStyle::setCursorList(PassRefPtr<CursorList> other)
478 {
479 rareInheritedData.access()->cursorData = other;
480 }
481
482 void RenderStyle::setQuotes(PassRefPtr<QuotesData> q) 470 void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
483 { 471 {
484 rareInheritedData.access()->quotes = q; 472 rareInheritedData.access()->quotes = q;
485 } 473 }
486 474
487 void RenderStyle::clearCursorList()
488 {
489 if (rareInheritedData->cursorData)
490 rareInheritedData.access()->cursorData = nullptr;
491 }
492
493 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin) 475 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
494 { 476 {
495 // transform-origin brackets the transform with translate operations. 477 // transform-origin brackets the transform with translate operations.
496 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant 478 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant
497 // in that case. 479 // in that case.
498 if (applyOrigin != RenderStyle::IncludeTransformOrigin) 480 if (applyOrigin != RenderStyle::IncludeTransformOrigin)
499 return false; 481 return false;
500 482
501 unsigned size = transformOperations.size(); 483 unsigned size = transformOperations.size();
502 for (unsigned i = 0; i < size; ++i) { 484 for (unsigned i = 0; i < size; ++i) {
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 // right 1168 // right
1187 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1169 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1188 if (radiiSum > rect.height()) 1170 if (radiiSum > rect.height())
1189 factor = std::min(rect.height() / radiiSum, factor); 1171 factor = std::min(rect.height() / radiiSum, factor);
1190 1172
1191 ASSERT(factor <= 1); 1173 ASSERT(factor <= 1);
1192 return factor; 1174 return factor;
1193 } 1175 }
1194 1176
1195 } // namespace blink 1177 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/engine/core/rendering/style/RenderStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698