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

Side by Side Diff: Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp

Issue 10383285: Merge 116174 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 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) 2010 Alex Milowski (alex@milowski.com). All rights reserved. 2 * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 Element* childElement = toElement(child->node()); 69 Element* childElement = toElement(child->node());
70 70
71 if (childElement && !childElement->previousElementSibling()) { 71 if (childElement && !childElement->previousElementSibling()) {
72 // Position 1 is always the base of the msub/msup/msubsup. 72 // Position 1 is always the base of the msub/msup/msubsup.
73 RenderBlock* baseWrapper = createAlmostAnonymousBlock(INLINE_BLOCK); 73 RenderBlock* baseWrapper = createAlmostAnonymousBlock(INLINE_BLOCK);
74 RenderMathMLBlock::addChild(baseWrapper, firstChild()); 74 RenderMathMLBlock::addChild(baseWrapper, firstChild());
75 baseWrapper->addChild(child); 75 baseWrapper->addChild(child);
76 76
77 // Make sure we have a script block for rendering. 77 // Make sure we have a script block for rendering.
78 if (m_kind == SubSup && !m_scripts) { 78 if (m_kind == SubSup && !m_scripts) {
79 RefPtr<RenderStyle> scriptsStyle = RenderStyle::createAnonymousStyle (style()); 79 RefPtr<RenderStyle> scriptsStyle = RenderStyle::createAnonymousStyle WithDisplay(style(), INLINE_BLOCK);
80 scriptsStyle->setDisplay(INLINE_BLOCK);
81 scriptsStyle->setVerticalAlign(TOP); 80 scriptsStyle->setVerticalAlign(TOP);
82 scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed)); 81 scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed));
83 scriptsStyle->setTextAlign(LEFT); 82 scriptsStyle->setTextAlign(LEFT);
84 // Set this wrapper's font-size for its line-height & baseline posit ion. 83 // Set this wrapper's font-size for its line-height & baseline posit ion.
85 scriptsStyle->setBlendedFontSize(static_cast<int>(0.75 * style()->fo ntSize())); 84 scriptsStyle->setBlendedFontSize(static_cast<int>(0.75 * style()->fo ntSize()));
86 m_scripts = new (renderArena()) RenderMathMLBlock(node()); 85 m_scripts = new (renderArena()) RenderMathMLBlock(node());
87 m_scripts->setStyle(scriptsStyle); 86 m_scripts->setStyle(scriptsStyle);
88 RenderMathMLBlock::addChild(m_scripts, beforeChild); 87 RenderMathMLBlock::addChild(m_scripts, beforeChild);
89 } 88 }
90 } else { 89 } else {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 superscriptWrapper->style()->setPaddingBottom(Length(superPaddingBottom, Fix ed)); 177 superscriptWrapper->style()->setPaddingBottom(Length(superPaddingBottom, Fix ed));
179 superscriptWrapper->setNeedsLayout(true, false); 178 superscriptWrapper->setNeedsLayout(true, false);
180 m_scripts->setNeedsLayout(true, false); 179 m_scripts->setNeedsLayout(true, false);
181 180
182 RenderBlock::layout(); 181 RenderBlock::layout();
183 } 182 }
184 183
185 } 184 }
186 185
187 #endif // ENABLE(MATHML) 186 #endif // ENABLE(MATHML)
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/mathml/RenderMathMLRow.cpp ('k') | Source/WebCore/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698