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

Side by Side Diff: Source/core/rendering/RenderRubyText.cpp

Issue 339333002: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing mac error Created 6 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
« no previous file with comments | « Source/core/rendering/RenderRubyRun.cpp ('k') | Source/core/rendering/RenderScrollbarPart.cpp » ('j') | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 15 matching lines...) Expand all
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 33
34 #include "core/rendering/RenderRubyText.h" 34 #include "core/rendering/RenderRubyText.h"
35 35
36 using namespace std;
37
38 namespace WebCore { 36 namespace WebCore {
39 37
40 RenderRubyText::RenderRubyText(Element* element) 38 RenderRubyText::RenderRubyText(Element* element)
41 : RenderBlockFlow(element) 39 : RenderBlockFlow(element)
42 { 40 {
43 } 41 }
44 42
45 RenderRubyText::~RenderRubyText() 43 RenderRubyText::~RenderRubyText()
46 { 44 {
47 } 45 }
(...skipping 22 matching lines...) Expand all
70 return RenderBlockFlow::adjustInlineDirectionLineBounds(expansionOpportu nityCount, logicalLeft, logicalWidth); 68 return RenderBlockFlow::adjustInlineDirectionLineBounds(expansionOpportu nityCount, logicalLeft, logicalWidth);
71 69
72 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth(); 70 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth();
73 if (maxPreferredLogicalWidth >= logicalWidth) 71 if (maxPreferredLogicalWidth >= logicalWidth)
74 return; 72 return;
75 73
76 // Inset the ruby text by half the inter-ideograph expansion amount, but no more than a full-width 74 // Inset the ruby text by half the inter-ideograph expansion amount, but no more than a full-width
77 // ruby character on each side. 75 // ruby character on each side.
78 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun ityCount + 1); 76 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun ityCount + 1);
79 if (expansionOpportunityCount) 77 if (expansionOpportunityCount)
80 inset = min<float>(2 * style()->fontSize(), inset); 78 inset = std::min<float>(2 * style()->fontSize(), inset);
81 79
82 logicalLeft += inset / 2; 80 logicalLeft += inset / 2;
83 logicalWidth -= inset; 81 logicalWidth -= inset;
84 } 82 }
85 83
86 bool RenderRubyText::avoidsFloats() const 84 bool RenderRubyText::avoidsFloats() const
87 { 85 {
88 return true; 86 return true;
89 } 87 }
90 88
91 } // namespace WebCore 89 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderRubyRun.cpp ('k') | Source/core/rendering/RenderScrollbarPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698