(hostEl, ctx, text, style, rect, prevEl)
| 8586 | } |
| 8587 | |
| 8588 | function renderRichText(hostEl, ctx, text, style, rect, prevEl) { |
| 8589 | // Do not do cache for rich text because of the complexity. |
| 8590 | // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`. |
| 8591 | if (prevEl !== WILL_BE_RESTORED) { |
| 8592 | ctx.__attrCachedBy = ContextCachedBy.NONE; |
| 8593 | } |
| 8594 | |
| 8595 | var contentBlock = hostEl.__textCotentBlock; |
| 8596 | |
| 8597 | if (!contentBlock || hostEl.__dirtyText) { |
| 8598 | contentBlock = hostEl.__textCotentBlock = parseRichText(text, style); |
| 8599 | } |
| 8600 | |
| 8601 | drawRichText(hostEl, ctx, contentBlock, style, rect); |
| 8602 | } |
| 8603 | |
| 8604 | function drawRichText(hostEl, ctx, contentBlock, style, rect) { |
| 8605 | var contentWidth = contentBlock.width; |
no test coverage detected