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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 404343002: Introduce DEFINE_CONTENT_DATA_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/rendering/style/ContentData.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 { 777 {
778 OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; 778 OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content;
779 if (add) { 779 if (add) {
780 ContentData* lastContent = content.get(); 780 ContentData* lastContent = content.get();
781 while (lastContent && lastContent->next()) 781 while (lastContent && lastContent->next())
782 lastContent = lastContent->next(); 782 lastContent = lastContent->next();
783 783
784 if (lastContent) { 784 if (lastContent) {
785 // We attempt to merge with the last ContentData if possible. 785 // We attempt to merge with the last ContentData if possible.
786 if (lastContent->isText()) { 786 if (lastContent->isText()) {
787 TextContentData* textContent = static_cast<TextContentData*>(las tContent); 787 TextContentData* textContent = toTextContentData(lastContent);
788 textContent->setText(textContent->text() + string); 788 textContent->setText(textContent->text() + string);
789 } else 789 } else
790 lastContent->setNext(ContentData::create(string)); 790 lastContent->setNext(ContentData::create(string));
791 791
792 return; 792 return;
793 } 793 }
794 } 794 }
795 795
796 content = ContentData::create(string); 796 content = ContentData::create(string);
797 } 797 }
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 // right 1687 // right
1688 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1688 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1689 if (radiiSum > rect.height()) 1689 if (radiiSum > rect.height())
1690 factor = std::min(rect.height() / radiiSum, factor); 1690 factor = std::min(rect.height() / radiiSum, factor);
1691 1691
1692 ASSERT(factor <= 1); 1692 ASSERT(factor <= 1);
1693 return factor; 1693 return factor;
1694 } 1694 }
1695 1695
1696 } // namespace blink 1696 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/style/ContentData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698