Changeset 176465 in webkit
- Timestamp:
- Nov 21, 2014, 12:42:14 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
rendering/mathml/RenderMathMLScripts.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176464 r176465 1 2014-11-21 Andreas Kling <akling@apple.com> 2 3 RenderMathMLScripts isPrescript() helper should take a reference. 4 <https://webkit.org/b/138975> 5 6 Reviewed by Antti Koivisto. 7 8 Tidy this up a bit, since it's never called with a null pointer. 9 10 * rendering/mathml/RenderMathMLScripts.cpp: 11 (WebCore::isPrescript): 12 (WebCore::RenderMathMLScripts::fixAnonymousStyles): 13 (WebCore::RenderMathMLScripts::addChildInternal): 14 (WebCore::RenderMathMLScripts::removeChildInternal): 15 (WebCore::RenderMathMLScripts::layout): 16 (WebCore::RenderMathMLScriptsWrapper::addChildInternal): 17 (WebCore::RenderMathMLScriptsWrapper::removeChildInternal): 18 1 19 2014-11-21 Anders Carlsson <andersca@apple.com> 2 20 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
r176258 r176465 51 51 // 52 52 53 static bool isPrescript(RenderObject* renderObject) 54 { 55 ASSERT(renderObject); 56 return renderObject->node() && renderObject->node()->hasTagName(MathMLNames::mprescriptsTag); 53 static bool isPrescript(const RenderObject& renderObject) 54 { 55 return renderObject.node() && renderObject.node()->hasTagName(MathMLNames::mprescriptsTag); 57 56 } 58 57 … … 120 119 // This sets the style for postscript pairs. 121 120 RenderObject* subSupPair = m_baseWrapper; 122 for (subSupPair = subSupPair->nextSibling(); subSupPair && !isPrescript( subSupPair); subSupPair = subSupPair->nextSibling())121 for (subSupPair = subSupPair->nextSibling(); subSupPair && !isPrescript(*subSupPair); subSupPair = subSupPair->nextSibling()) 123 122 fixAnonymousStyleForSubSupPair(subSupPair, true); 124 123 125 124 if (subSupPair && m_kind == Multiscripts) { 126 125 // This sets the style for prescript pairs. 127 for (subSupPair = subSupPair->nextSibling(); subSupPair && !isPrescript( subSupPair); subSupPair = subSupPair->nextSibling())126 for (subSupPair = subSupPair->nextSibling(); subSupPair && !isPrescript(*subSupPair); subSupPair = subSupPair->nextSibling()) 128 127 fixAnonymousStyleForSubSupPair(subSupPair, false); 129 128 } … … 131 130 // This resets style for extra subSup pairs. 132 131 for (; subSupPair; subSupPair = subSupPair->nextSibling()) { 133 if (!isPrescript( subSupPair)) {132 if (!isPrescript(*subSupPair)) { 134 133 ASSERT(subSupPair && subSupPair->style().refCount() == 1); 135 134 RenderStyle& scriptsStyle = subSupPair->style(); … … 169 168 } 170 169 171 if (isPrescript( child)) {170 if (isPrescript(*child)) { 172 171 // The new child becomes an <mprescripts/> separator. 173 172 RenderMathMLBlock::addChild(child, beforeChild); … … 175 174 } 176 175 177 if (!beforeChild || isPrescript( beforeChild)) {176 if (!beforeChild || isPrescript(*beforeChild)) { 178 177 // We are at the end of a sequence of subSup pairs. 179 178 RenderMathMLBlock* previousSibling = downcast<RenderMathMLBlock>(beforeChild ? beforeChild->previousSibling() : lastChild()); … … 205 204 return RenderMathMLBlock::removeChild(child); 206 205 207 ASSERT(isPrescript( &child));206 ASSERT(isPrescript(child)); 208 207 209 208 RenderObject* previousSibling = child.previousSibling(); … … 211 210 ASSERT(previousSibling); 212 211 213 if (nextSibling && !isPrescript( previousSibling) && !isPrescript(nextSibling)) {212 if (nextSibling && !isPrescript(*previousSibling) && !isPrescript(*nextSibling)) { 214 213 RenderMathMLScriptsWrapper& previousWrapper = downcast<RenderMathMLScriptsWrapper>(*previousSibling); 215 214 RenderMathMLScriptsWrapper& nextWrapper = downcast<RenderMathMLScriptsWrapper>(*nextSibling); … … 307 306 308 307 // We skip the base and <mprescripts/> elements. 309 if (isPrescript( subSupPair)) {308 if (isPrescript(*subSupPair)) { 310 309 if (!isPostScript) 311 310 break; … … 397 396 if (oldBase) 398 397 RenderMathMLBlock::removeChild(*oldBase); 399 if (isPrescript( child))398 if (isPrescript(*child)) 400 399 parentNode->addChildInternal(true, child, sibling); 401 400 else … … 406 405 } 407 406 408 if (isPrescript( child)) {407 if (isPrescript(*child)) { 409 408 // We insert an <mprescripts> element. 410 409 if (!beforeChild) … … 432 431 // We first move to the last subSup pair in the curent sequence of scripts. 433 432 RenderMathMLScriptsWrapper* subSupPair = this; 434 while (subSupPair->nextSibling() && !isPrescript( subSupPair->nextSibling()))433 while (subSupPair->nextSibling() && !isPrescript(*subSupPair->nextSibling())) 435 434 subSupPair = downcast<RenderMathMLScriptsWrapper>(subSupPair->nextSibling()); 436 435 if (subSupPair->firstChild()->nextSibling()) { … … 474 473 RenderObject* sibling = nextSibling(); 475 474 RenderMathMLBlock::removeChild(child); 476 if (sibling && !isPrescript( sibling)) {475 if (sibling && !isPrescript(*sibling)) { 477 476 // If there are postscripts, the first one becomes the base. 478 477 RenderMathMLScriptsWrapper& wrapper = downcast<RenderMathMLScriptsWrapper>(*sibling); … … 487 486 RenderObject* next = RenderMathMLBlock::removeChild(child); 488 487 RenderMathMLScriptsWrapper* subSupPair = this; 489 for (RenderObject* nextSibling = subSupPair->nextSibling(); nextSibling && !isPrescript( nextSibling); nextSibling = nextSibling->nextSibling()) {488 for (RenderObject* nextSibling = subSupPair->nextSibling(); nextSibling && !isPrescript(*nextSibling); nextSibling = nextSibling->nextSibling()) { 490 489 RenderMathMLScriptsWrapper& nextSubSupPair = downcast<RenderMathMLScriptsWrapper>(*nextSibling); 491 490 RenderObject* script = nextSubSupPair.firstChild();
Note:
See TracChangeset
for help on using the changeset viewer.