< prev index next >

modules/javafx.web/src/main/native/Source/WebCore/rendering/RenderListMarker.cpp

Print this page




1365             }
1366             toDraw = buffer.toString();
1367         } else {
1368             if (style().isLeftToRightDirection())
1369                 toDraw = m_text + String(&suffix, 1) + String(&space, 1);
1370             else
1371                 toDraw = String(&space, 1) + String(&suffix, 1) + m_text;
1372         }
1373         textRun.setText(StringView(toDraw));
1374 
1375         context.drawText(font, textRun, textOrigin);
1376     }
1377 }
1378 
1379 void RenderListMarker::layout()
1380 {
1381     StackStats::LayoutCheckPoint layoutCheckPoint;
1382     ASSERT(needsLayout());
1383 
1384     LayoutUnit blockOffset;
1385     for (auto* box = parentBox(); box && box != &m_listItem; box = box->parentBox())
1386         blockOffset += box->logicalTop();
1387     if (style().isLeftToRightDirection())
1388         m_lineOffsetForListItem = m_listItem.logicalLeftOffsetForLine(blockOffset, DoNotIndentText, LayoutUnit());
1389     else
1390         m_lineOffsetForListItem = m_listItem.logicalRightOffsetForLine(blockOffset, DoNotIndentText, LayoutUnit());
1391 
1392     if (isImage()) {
1393         updateMarginsAndContent();
1394         setWidth(m_image->imageSize(this, style().effectiveZoom()).width());
1395         setHeight(m_image->imageSize(this, style().effectiveZoom()).height());
1396     } else {
1397         setLogicalWidth(minPreferredLogicalWidth());
1398         setLogicalHeight(style().fontMetrics().height());
1399     }
1400 
1401     setMarginStart(0);
1402     setMarginEnd(0);
1403 
1404     Length startMargin = style().marginStart();
1405     Length endMargin = style().marginEnd();
1406     if (startMargin.isFixed())




1365             }
1366             toDraw = buffer.toString();
1367         } else {
1368             if (style().isLeftToRightDirection())
1369                 toDraw = m_text + String(&suffix, 1) + String(&space, 1);
1370             else
1371                 toDraw = String(&space, 1) + String(&suffix, 1) + m_text;
1372         }
1373         textRun.setText(StringView(toDraw));
1374 
1375         context.drawText(font, textRun, textOrigin);
1376     }
1377 }
1378 
1379 void RenderListMarker::layout()
1380 {
1381     StackStats::LayoutCheckPoint layoutCheckPoint;
1382     ASSERT(needsLayout());
1383 
1384     LayoutUnit blockOffset;
1385     for (auto* ancestor = parentBox(); ancestor && ancestor != &m_listItem; ancestor = ancestor->parentBox())
1386         blockOffset += ancestor->logicalTop();
1387     if (style().isLeftToRightDirection())
1388         m_lineOffsetForListItem = m_listItem.logicalLeftOffsetForLine(blockOffset, DoNotIndentText, LayoutUnit());
1389     else
1390         m_lineOffsetForListItem = m_listItem.logicalRightOffsetForLine(blockOffset, DoNotIndentText, LayoutUnit());
1391 
1392     if (isImage()) {
1393         updateMarginsAndContent();
1394         setWidth(m_image->imageSize(this, style().effectiveZoom()).width());
1395         setHeight(m_image->imageSize(this, style().effectiveZoom()).height());
1396     } else {
1397         setLogicalWidth(minPreferredLogicalWidth());
1398         setLogicalHeight(style().fontMetrics().height());
1399     }
1400 
1401     setMarginStart(0);
1402     setMarginEnd(0);
1403 
1404     Length startMargin = style().marginStart();
1405     Length endMargin = style().marginEnd();
1406     if (startMargin.isFixed())


< prev index next >