Add an optimization to make line height and box placement calculations faster. Basically try to avoid spending as much time in computeLogicalBoxHeights and placeBoxesInBlockDirection.
Created attachment 87219 [details] Patch
Created attachment 87353 [details] Patch
Comment on attachment 87353 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=87353&action=review > Source/WebCore/rendering/InlineFlowBox.cpp:105 > + InlineFlowBox* childFlowBox = static_cast<InlineFlowBox*>(child); > + if (childFlowBox->hasTextDescendants()) > + m_hasTextDescendants = true; I don’t think the local variable here is helpful. > Source/WebCore/rendering/InlineFlowBox.cpp:110 > + RenderStyle* parentStyle = renderer()->style(m_firstLine); > + RenderStyle* childStyle = child->renderer()->style(m_firstLine); Seems a shame to always compute these, since they are not always used. > Source/WebCore/rendering/InlineFlowBox.cpp:111 > + bool changeResult = false; Not sure what “change result” means in this name. Can you come up with a better name. > Source/WebCore/rendering/InlineFlowBox.cpp:521 > - if (curr->isInlineFlowBox()) > - static_cast<InlineFlowBox*>(curr)->computeLogicalBoxHeights(rootBox, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, > - setMaxAscent, setMaxDescent, strictMode, textBoxDataMap, > - baselineType, verticalPositionCache); > + if (inlineFlowBox) > + inlineFlowBox->computeLogicalBoxHeights(rootBox, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, > + setMaxAscent, setMaxDescent, strictMode, textBoxDataMap, > + baselineType, verticalPositionCache); It’s better to not line up the subsequent lines so you don’t have to move them when making a change like this one. Also, there should be braces in this if statement.