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

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

Issue 13679002: Add StyleChangeState to get rid of a bunch of static state in the render tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 2 * Copyright (C) 2009 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 RenderMathMLRow::addChild(separatorRenderer, beforeChild); 144 RenderMathMLRow::addChild(separatorRenderer, beforeChild);
145 } else { 145 } else {
146 // Adding |y| at the end of an existing element e.g. (x) - insert the se parator first before the closing fence, then |y|, to get (x, y). 146 // Adding |y| at the end of an existing element e.g. (x) - insert the se parator first before the closing fence, then |y|, to get (x, y).
147 if (separatorRenderer) 147 if (separatorRenderer)
148 RenderMathMLRow::addChild(separatorRenderer, m_closeFenceRenderer); 148 RenderMathMLRow::addChild(separatorRenderer, m_closeFenceRenderer);
149 RenderMathMLRow::addChild(child, m_closeFenceRenderer); 149 RenderMathMLRow::addChild(child, m_closeFenceRenderer);
150 } 150 }
151 } 151 }
152 152
153 // FIXME: Change createMathMLOperator() above to create an isAnonymous() operato r, and remove this styleDidChange() function. 153 // FIXME: Change createMathMLOperator() above to create an isAnonymous() operato r, and remove this styleDidChange() function.
154 void RenderMathMLFenced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 154 void RenderMathMLFenced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle, const StyleChangeState& state)
155 { 155 {
156 RenderMathMLBlock::styleDidChange(diff, oldStyle); 156 RenderMathMLBlock::styleDidChange(diff, oldStyle, state);
157 157
158 for (RenderObject* child = firstChild(); child; child = child->nextSibling() ) { 158 for (RenderObject* child = firstChild(); child; child = child->nextSibling() ) {
159 if (child->node() == node()) { 159 if (child->node() == node()) {
160 ASSERT(child->style()->refCount() == 1); 160 ASSERT(child->style()->refCount() == 1);
161 child->style()->inheritFrom(style()); 161 child->style()->inheritFrom(style());
162 bool isFence = child == firstChild() || child == lastChild(); 162 bool isFence = child == firstChild() || child == lastChild();
163 child->style()->setMarginEnd(Length((isFence ? gFenceMarginEms : gSe paratorMarginEndEms) * style()->fontSize(), Fixed)); 163 child->style()->setMarginEnd(Length((isFence ? gFenceMarginEms : gSe paratorMarginEndEms) * style()->fontSize(), Fixed));
164 if (isFence) 164 if (isFence)
165 child->style()->setMarginStart(Length(gFenceMarginEms * style()- >fontSize(), Fixed)); 165 child->style()->setMarginStart(Length(gFenceMarginEms * style()- >fontSize(), Fixed));
166 } 166 }
167 } 167 }
168 } 168 }
169 169
170 } 170 }
171 171
172 #endif 172 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698