Changeset 282150 in webkit
- Timestamp:
- Sep 8, 2021, 10:11:09 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderInline.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r282144 r282150 1 2021-09-08 Antti Koivisto <antti@apple.com> 2 3 [LFC][Integration] Hovering over link switches to legacy inline boxes 4 https://bugs.webkit.org/show_bug.cgi?id=226812 5 <rdar://problem/79394047> 6 7 Reviewed by Alan Bujtas. 8 9 * web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt: 10 1 11 2021-09-08 Simon Fraser <simon.fraser@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt
r254129 r282150 1 1 2 FAIL getBoundingClientRect-empty-inline assert_equals: y expected 92 but got 0 2 PASS getBoundingClientRect-empty-inline 3 3 -
trunk/Source/WebCore/ChangeLog
r282149 r282150 1 2021-09-08 Antti Koivisto <antti@apple.com> 2 3 [LFC][Integration] Hovering over link switches to legacy inline boxes 4 https://bugs.webkit.org/show_bug.cgi?id=226812 5 <rdar://problem/79394047> 6 7 Reviewed by Alan Bujtas. 8 9 Implement rect/quad collection functions in RenderInline by getting data from LFC. 10 11 * layout/integration/LayoutIntegrationLineLayout.cpp: 12 (WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const): 13 14 Some tests taking LFC path were affected by the missing implementation here. 15 16 (WebCore::LayoutIntegration::LineLayout::collectInlineBoxRects const): 17 * layout/integration/LayoutIntegrationLineLayout.h: 18 * rendering/RenderInline.cpp: 19 (WebCore::RenderInline::generateLineBoxRects const): 20 (WebCore::RenderInline::absoluteRects const): 21 (WebCore::RenderInline::absoluteQuads const): 22 (WebCore::RenderInline::absoluteQuadsIgnoringContinuation const): 23 (WebCore::RenderInline::absoluteQuadsForSelection const): 24 (WebCore::RenderInline::addFocusRingRects): 25 1 26 2021-09-08 Youenn Fablet <youenn@apple.com> 2 27 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r282060 r282150 426 426 LayoutRect LineLayout::visualOverflowBoundingBoxRectFor(const RenderInline& renderInline) const 427 427 { 428 // FIXME: This doesn't contain overflow. 429 return enclosingBorderBoxRectFor(renderInline); 428 LayoutRect result; 429 430 auto& layoutBox = m_boxTree.layoutBoxForRenderer(renderInline); 431 for (auto& run : m_inlineContent->runs) { 432 if (&run.layoutBox() != &layoutBox) 433 continue; 434 result.unite(Layout::toLayoutRect(run.inkOverflow())); 435 } 436 437 return result; 438 } 439 440 Vector<FloatRect> LineLayout::collectInlineBoxRects(const RenderInline& renderInline) const 441 { 442 if (!m_inlineContent) 443 return { }; 444 445 Vector<FloatRect> result; 446 447 auto& layoutBox = m_boxTree.layoutBoxForRenderer(renderInline); 448 for (auto& run : m_inlineContent->runs) { 449 if (&run.layoutBox() != &layoutBox) 450 continue; 451 result.append(run.logicalRect()); 452 } 453 454 return result; 430 455 } 431 456 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r281377 r282150 28 28 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 29 29 30 #include "FloatRect.h" 30 31 #include "LayoutIntegrationBoxTree.h" 31 32 #include "LayoutIntegrationLineIterator.h" … … 98 99 LayoutRect enclosingBorderBoxRectFor(const RenderInline&) const; 99 100 LayoutRect visualOverflowBoundingBoxRectFor(const RenderInline&) const; 101 Vector<FloatRect> collectInlineBoxRects(const RenderInline&) const; 100 102 101 103 const RenderObject& rendererForLayoutBox(const Layout::Box&) const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r282129 r282150 254 254 void RenderInline::generateLineBoxRects(GeneratorContext& context) const 255 255 { 256 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 257 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this)) { 258 auto inlineBoxRects = lineLayout->collectInlineBoxRects(*this); 259 if (inlineBoxRects.isEmpty()) { 260 context.addRect({ }); 261 return; 262 } 263 for (auto inlineBoxRect : inlineBoxRects) 264 context.addRect(inlineBoxRect); 265 return; 266 } 267 #endif 256 268 if (!alwaysCreateLineBoxes()) 257 269 generateCulledLineBoxRects(context, this); … … 343 355 } 344 356 345 namespace {346 347 357 class AbsoluteRectsGeneratorContext { 348 358 public: … … 362 372 }; 363 373 364 } // unnamed namespace365 366 374 void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const 367 375 { 368 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)369 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))370 lineLayout->flow().ensureLineBoxes();371 #endif372 376 Vector<LayoutRect> lineboxRects; 373 377 AbsoluteRectsGeneratorContext context(lineboxRects, accumulatedOffset); … … 384 388 } 385 389 } 386 387 390 388 391 namespace { … … 410 413 void RenderInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const 411 414 { 412 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)413 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))414 lineLayout->flow().ensureLineBoxes();415 #endif416 415 absoluteQuadsIgnoringContinuation({ }, quads, wasFixed); 417 416 if (continuation()) … … 421 420 void RenderInline::absoluteQuadsIgnoringContinuation(const FloatRect&, Vector<FloatQuad>& quads, bool*) const 422 421 { 423 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)424 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))425 lineLayout->flow().ensureLineBoxes();426 #endif427 422 AbsoluteQuadsGeneratorContext context(this, quads); 428 423 generateLineBoxRects(context); … … 432 427 void RenderInline::absoluteQuadsForSelection(Vector<FloatQuad>& quads) const 433 428 { 434 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)435 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))436 lineLayout->flow().ensureLineBoxes();437 #endif438 429 AbsoluteQuadsGeneratorContext context(this, quads); 439 430 generateLineBoxRects(context); … … 611 602 } 612 603 613 namespace {614 615 604 class LinesBoundingBoxGeneratorContext { 616 605 public: … … 624 613 FloatRect& m_rect; 625 614 }; 626 627 } // unnamed namespace628 615 629 616 IntRect RenderInline::linesBoundingBox() const … … 1219 1206 void RenderInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer) 1220 1207 { 1221 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)1222 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(const_cast<RenderInline&>(*this)))1223 lineLayout->flow().ensureLineBoxes();1224 #endif1225 1208 AbsoluteRectsGeneratorContext context(rects, additionalOffset); 1226 1209 generateLineBoxRects(context);
Note:
See TracChangeset
for help on using the changeset viewer.