Changeset 240842 in webkit
- Timestamp:
- Feb 1, 2019 6:15:09 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240841 r240842 1 2019-02-01 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Set intrinsic size on Layout::Replaced 4 https://bugs.webkit.org/show_bug.cgi?id=194139 5 6 Reviewed by Antti Koivisto. 7 8 Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced. 9 10 * layout/layouttree/LayoutBox.h: 11 (WebCore::Layout::Box::replaced): 12 * layout/layouttree/LayoutReplaced.cpp: 13 (WebCore::Layout::Replaced::hasIntrinsicWidth const): 14 (WebCore::Layout::Replaced::hasIntrinsicHeight const): 15 (WebCore::Layout::Replaced::intrinsicWidth const): 16 (WebCore::Layout::Replaced::intrinsicHeight const): 17 * layout/layouttree/LayoutReplaced.h: 18 (WebCore::Layout::Replaced::setIntrinsicSize): 19 (WebCore::Layout::Replaced::setIntrinsicRatio): 20 * layout/layouttree/LayoutTreeBuilder.cpp: 21 (WebCore::Layout::TreeBuilder::createSubTree): 22 * rendering/RenderReplaced.h: 23 1 24 2019-02-01 Claudio Saavedra <csaavedra@igalia.com> 2 25 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.h
r240779 r240842 132 132 133 133 const Replaced* replaced() const { return m_replaced.get(); } 134 // FIXME: Temporary until after intrinsic size change is tracked by Replaced. 135 Replaced* replaced() { return m_replaced.get(); } 134 136 135 137 void setParent(Container& parent) { m_parent = &parent; } … … 148 150 Box* m_nextSibling { nullptr }; 149 151 150 std::unique_ptr< constReplaced> m_replaced;152 std::unique_ptr<Replaced> m_replaced; 151 153 152 154 unsigned m_baseTypeFlags : 4; -
trunk/Source/WebCore/layout/layouttree/LayoutReplaced.cpp
r237321 r240842 45 45 bool Replaced::hasIntrinsicWidth() const 46 46 { 47 return m_ layoutBox->style().logicalWidth().isIntrinsic();47 return m_intrinsicSize || m_layoutBox->style().logicalWidth().isIntrinsic(); 48 48 } 49 49 50 50 bool Replaced::hasIntrinsicHeight() const 51 51 { 52 return m_ layoutBox->style().logicalHeight().isIntrinsic();52 return m_intrinsicSize || m_layoutBox->style().logicalHeight().isIntrinsic(); 53 53 } 54 54 … … 61 61 { 62 62 ASSERT(hasIntrinsicWidth()); 63 if (m_intrinsicSize) 64 return m_intrinsicSize->width(); 63 65 return m_layoutBox->style().logicalWidth().value(); 64 66 } … … 67 69 { 68 70 ASSERT(hasIntrinsicHeight()); 71 if (m_intrinsicSize) 72 return m_intrinsicSize->height(); 69 73 return m_layoutBox->style().logicalHeight().value(); 70 74 } -
trunk/Source/WebCore/layout/layouttree/LayoutReplaced.h
r237321 r240842 28 28 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 29 29 30 #include "LayoutSize.h" 30 31 #include "LayoutUnit.h" 31 32 #include <wtf/IsoMalloc.h> … … 44 45 ~Replaced() = default; 45 46 47 // FIXME: Temporary until after intrinsic size change is tracked internallys. 48 void setIntrinsicSize(LayoutSize size) { m_intrinsicSize = size; } 49 void setIntrinsicRatio(LayoutUnit ratio) { m_intrinsicRatio = ratio; }; 50 46 51 bool hasIntrinsicWidth() const; 47 52 bool hasIntrinsicHeight() const; … … 53 58 private: 54 59 WeakPtr<const Box> m_layoutBox; 60 Optional<LayoutSize> m_intrinsicSize; 61 Optional<LayoutUnit> m_intrinsicRatio; 55 62 }; 56 63 -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r240779 r240842 98 98 else 99 99 box = std::make_unique<InlineBox>(elementAttributes(renderer), RenderStyle::clone(renderer.style())); 100 // FIXME: We don't yet support all replaced elements. 101 if (box->replaced()) 102 box->replaced()->setIntrinsicSize(renderer.intrinsicSize()); 100 103 } else if (is<RenderElement>(child)) { 101 104 auto& renderer = downcast<RenderElement>(child); -
trunk/Source/WebCore/rendering/RenderReplaced.h
r239427 r240842 41 41 bool setNeedsLayoutIfNeededAfterIntrinsicSizeChange(); 42 42 43 LayoutSize intrinsicSize() const final { return m_intrinsicSize; } 44 43 45 protected: 44 46 RenderReplaced(Element&, RenderStyle&&); … … 48 50 void layout() override; 49 51 50 LayoutSize intrinsicSize() const final { return m_intrinsicSize; }51 52 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const override; 52 53 -
trunk/Tools/ChangeLog
r240840 r240842 1 2019-02-01 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Set intrinsic size on Layout::Replaced 4 https://bugs.webkit.org/show_bug.cgi?id=194139 5 6 Reviewed by Antti Koivisto. 7 8 744 9 10 * LayoutReloaded/misc/LFC-passing-tests.txt: 11 1 12 2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt
r240781 r240842 416 416 css2.1/20110323/absolute-non-replaced-width-015.htm 417 417 css2.1/20110323/absolute-non-replaced-width-016.htm 418 css2.1/20110323/absolute-replaced-height-004.htm419 css2.1/20110323/absolute-replaced-height-005.htm420 css2.1/20110323/absolute-replaced-height-007.htm421 css2.1/20110323/absolute-replaced-height-011.htm422 css2.1/20110323/absolute-replaced-height-012.htm423 css2.1/20110323/absolute-replaced-height-014.htm424 css2.1/20110323/absolute-replaced-height-018.htm425 css2.1/20110323/absolute-replaced-height-019.htm426 css2.1/20110323/absolute-replaced-height-021.htm427 css2.1/20110323/absolute-replaced-height-025.htm428 css2.1/20110323/absolute-replaced-height-026.htm429 css2.1/20110323/block-replaced-height-004.htm430 css2.1/20110323/block-replaced-height-005.htm431 css2.1/20110323/block-replaced-height-007.htm432 418 css2.1/t0402-c71-fwd-parsing-00-f.html 433 419 css2.1/t0402-c71-fwd-parsing-01-f.html … … 450 436 css2.1/t0511-c21-pseud-link-03-e.html 451 437 css2.1/t0602-c13-inh-underlin-00-e.html 438 css2.1/20110323/absolute-replaced-height-001.htm 439 css2.1/20110323/absolute-replaced-height-002.htm 452 440 css2.1/t0603-c11-import-00-b.html 441 css2.1/20110323/absolute-replaced-height-004.htm 442 css2.1/20110323/absolute-replaced-height-005.htm 443 css2.1/20110323/absolute-replaced-height-007.htm 444 css2.1/20110323/absolute-replaced-height-008.htm 445 css2.1/20110323/absolute-replaced-height-009.htm 446 css2.1/20110323/absolute-replaced-height-011.htm 447 css2.1/20110323/absolute-replaced-height-012.htm 448 css2.1/20110323/absolute-replaced-height-014.htm 449 css2.1/20110323/absolute-replaced-height-016.htm 453 450 css2.1/t0803-c5502-imrgn-r-00-b-ag.html 451 css2.1/20110323/absolute-replaced-height-018.htm 452 css2.1/20110323/absolute-replaced-height-019.htm 453 css2.1/20110323/absolute-replaced-height-021.htm 454 css2.1/20110323/absolute-replaced-height-022.htm 455 css2.1/20110323/absolute-replaced-height-023.htm 456 css2.1/20110323/absolute-replaced-height-025.htm 457 css2.1/20110323/absolute-replaced-height-026.htm 458 css2.1/20110323/absolute-replaced-height-028.htm 459 css2.1/20110323/absolute-replaced-height-029.htm 460 css2.1/20110323/absolute-replaced-height-030.htm 461 css2.1/20110323/absolute-replaced-height-032.htm 462 css2.1/20110323/absolute-replaced-height-033.htm 463 css2.1/20110323/absolute-replaced-height-035.htm 464 css2.1/20110323/absolute-replaced-height-036.htm 465 css2.1/20110323/absolute-replaced-width-001.htm 466 css2.1/20110323/absolute-replaced-width-008.htm 454 467 css2.1/t0803-c5502-mrgn-r-02-c.html 455 468 css2.1/t0803-c5502-mrgn-r-03-c.html … … 464 477 css2.1/t0804-c5506-ipadn-t-02-b-a.html 465 478 css2.1/t0804-c5507-ipadn-r-00-b-ag.html 479 css2.1/20110323/abspos-containing-block-initial-001.htm 480 css2.1/20110323/abspos-containing-block-initial-004a.htm 481 css2.1/20110323/abspos-containing-block-initial-004b.htm 466 482 css2.1/t0804-c5507-padn-r-00-c-ag.html 467 483 css2.1/t0804-c5507-padn-r-02-f.html … … 470 486 css2.1/t0804-c5508-ipadn-b-01-f-a.html 471 487 css2.1/t0804-c5508-ipadn-b-02-b-a.html 488 css2.1/20110323/abspos-containing-block-initial-005a.htm 472 489 css2.1/t0804-c5509-ipadn-l-00-b-ag.html 490 css2.1/20110323/abspos-containing-block-initial-005c.htm 491 css2.1/20110323/abspos-containing-block-initial-007.htm 492 css2.1/20110323/abspos-containing-block-initial-009b.htm 493 css2.1/20110323/abspos-containing-block-initial-009e.htm 473 494 css2.1/t0804-c5509-padn-l-00-b-ag.html 474 495 css2.1/t0804-c5509-padn-l-02-f.html 496 css2.1/20110323/at-import-001.htm 497 css2.1/20110323/at-import-002.htm 498 css2.1/20110323/at-import-003.htm 499 css2.1/20110323/at-import-004.htm 500 css2.1/20110323/at-import-005.htm 501 css2.1/20110323/at-import-006.htm 502 css2.1/20110323/at-import-007.htm 503 css2.1/20110323/at-import-009.htm 504 css2.1/20110323/at-import-010.htm 505 css2.1/20110323/at-import-011.htm 475 506 css2.1/t0804-c5510-padn-00-b-ag.html 507 css2.1/20110323/background-intrinsic-003.htm 476 508 css2.1/t0804-c5510-padn-02-f.html 477 509 css2.1/t0805-c5511-brdr-tw-01-b-g.html … … 482 514 css2.1/t0805-c5512-brdr-rw-02-b.html 483 515 css2.1/t0805-c5512-brdr-rw-03-b.html 516 css2.1/20110323/background-intrinsic-008.htm 517 css2.1/20110323/background-intrinsic-009.htm 518 css2.1/20110323/block-non-replaced-height-001.htm 484 519 css2.1/t0805-c5513-brdr-bw-01-b-g.html 485 520 css2.1/t0805-c5513-brdr-bw-02-b.html 486 521 css2.1/t0805-c5513-brdr-bw-03-b.html 522 css2.1/20110323/block-non-replaced-height-003.htm 487 523 css2.1/t0805-c5514-brdr-lw-00-b.html 488 524 css2.1/t0805-c5514-brdr-lw-01-b-g.html … … 497 533 css2.1/t0805-c5517-ibrdr-s-00-a.html 498 534 css2.1/t0805-c5518-brdr-t-00-a.html 535 css2.1/20110323/block-non-replaced-height-007.htm 499 536 css2.1/t0805-c5518-ibrdr-t-00-a.html 500 css2.1/t0805-c5520-brdr-b-00-a.html501 css2.1/t0805-c5520-ibrdr-b-00-a.html502 css2.1/20110323/abspos-containing-block-initial-001.htm503 css2.1/20110323/abspos-containing-block-initial-004a.htm504 css2.1/20110323/abspos-containing-block-initial-004b.htm505 css2.1/t0805-c5522-brdr-00-b.html506 css2.1/20110323/abspos-containing-block-initial-005a.htm507 css2.1/20110323/abspos-containing-block-initial-005c.htm508 css2.1/20110323/abspos-containing-block-initial-007.htm509 css2.1/t0905-c414-flt-00-d.html510 css2.1/t0905-c414-flt-01-d-g.html511 css2.1/20110323/abspos-containing-block-initial-009b.htm512 css2.1/20110323/abspos-containing-block-initial-009e.htm513 css2.1/20110323/at-import-001.htm514 css2.1/20110323/at-import-002.htm515 css2.1/20110323/at-import-003.htm516 css2.1/20110323/at-import-004.htm517 css2.1/20110323/at-import-005.htm518 css2.1/20110323/at-import-006.htm519 css2.1/20110323/at-import-007.htm520 css2.1/20110323/at-import-009.htm521 css2.1/20110323/at-import-010.htm522 css2.1/20110323/at-import-011.htm523 css2.1/20110323/background-intrinsic-003.htm524 css2.1/20110323/background-intrinsic-008.htm525 css2.1/20110323/background-intrinsic-009.htm526 css2.1/20110323/block-non-replaced-height-001.htm527 css2.1/20110323/block-non-replaced-height-003.htm528 css2.1/t0905-c5525-fltinln-00-c-ag.html529 css2.1/20110323/block-non-replaced-height-007.htm530 537 css2.1/20110323/block-non-replaced-height-009.htm 531 538 css2.1/20110323/block-non-replaced-height-011.htm 532 539 css2.1/20110323/block-non-replaced-height-013.htm 533 540 css2.1/20110323/block-non-replaced-height-015.htm 541 css2.1/t0805-c5520-brdr-b-00-a.html 542 css2.1/t0805-c5520-ibrdr-b-00-a.html 534 543 css2.1/20110323/block-non-replaced-width-003.htm 535 544 css2.1/20110323/block-non-replaced-width-004.htm … … 538 547 css2.1/20110323/block-non-replaced-width-007.htm 539 548 css2.1/20110323/block-non-replaced-width-008.htm 549 css2.1/20110323/block-replaced-height-001.htm 550 css2.1/20110323/block-replaced-height-004.htm 551 css2.1/20110323/block-replaced-height-005.htm 552 css2.1/20110323/block-replaced-height-007.htm 553 css2.1/20110323/block-replaced-width-001.htm 554 css2.1/t0805-c5522-brdr-00-b.html 555 css2.1/t0905-c414-flt-00-d.html 556 css2.1/t0905-c414-flt-01-d-g.html 557 css2.1/t0905-c5525-fltinln-00-c-ag.html 540 558 css2.1/t1001-abs-pos-cb-01-b.html 541 559 css2.1/t1001-abs-pos-cb-02-b.html … … 647 665 css2.1/t060403-c21-pseu-id-00-e-i.html 648 666 css2.1/t090501-c414-flt-00-d.html 649 css2.1/t100303-c412-blockw-00-d-ag.html650 css2.1/t100801-c548-ln-ht-01-b-ag.html651 css2.1/t100801-c548-ln-ht-02-b-ag.html652 css2.1/t100801-c548-ln-ht-03-d-ag.html653 css2.1/t100801-c548-ln-ht-04-d-ag.html654 css2.1/t120401-scope-00-b.html655 css2.1/t120401-scope-04-d.html656 css2.1/t120403-content-none-00-c.html657 css2.1/t120403-display-none-00-c.html658 css2.1/t120403-visibility-00-c.html659 css2.1/t140201-c532-bgcolor-01-b.html660 css2.1/t140201-c533-bgimage-01-b-g.html661 css2.1/t140201-c534-bgre-00-b-ag.html662 css2.1/t140201-c534-bgre-01-b-ag.html663 css2.1/t140201-c534-bgreps-00-c-ag.html664 css2.1/t140201-c534-bgreps-01-c-ag.html665 css2.1/t140201-c534-bgreps-02-c-ag.html666 css2.1/t140201-c534-bgreps-03-c-ag.html667 css2.1/t140201-c534-bgreps-04-c-ag.html668 css2.1/t140201-c534-bgreps-05-c-ag.html669 css2.1/t140201-c535-bg-fixd-00-b-g.html670 css2.1/t140201-c536-bgpos-00-b-ag.html671 css2.1/t140201-c536-bgpos-01-b-ag.html672 css2.1/t140201-c537-bgfxps-00-c-ag.html673 667 css2.1/20110323/clip-001.html 674 668 css2.1/20110323/dynamic-top-change-001.htm 675 669 css2.1/20110323/dynamic-top-change-004.htm 670 css2.1/t100303-c412-blockw-00-d-ag.html 676 671 css2.1/20110323/empty-inline-001.htm 677 672 css2.1/20110323/eof-001.htm … … 689 684 css2.1/20110323/float-non-replaced-width-005.htm 690 685 css2.1/20110323/float-non-replaced-width-006.htm 686 css2.1/t100801-c548-ln-ht-01-b-ag.html 687 css2.1/t100801-c548-ln-ht-02-b-ag.html 688 css2.1/t100801-c548-ln-ht-03-d-ag.html 689 css2.1/t100801-c548-ln-ht-04-d-ag.html 690 css2.1/t120401-scope-00-b.html 691 691 css2.1/20110323/float-non-replaced-width-010.htm 692 css2.1/t120401-scope-04-d.html 693 css2.1/t120403-content-none-00-c.html 694 css2.1/t120403-display-none-00-c.html 695 css2.1/t120403-visibility-00-c.html 692 696 css2.1/20110323/float-non-replaced-width-012.htm 697 css2.1/20110323/float-replaced-height-001.htm 698 css2.1/t140201-c532-bgcolor-01-b.html 699 css2.1/t140201-c533-bgimage-01-b-g.html 700 css2.1/t140201-c534-bgre-00-b-ag.html 701 css2.1/t140201-c534-bgre-01-b-ag.html 702 css2.1/t140201-c534-bgreps-00-c-ag.html 703 css2.1/t140201-c534-bgreps-01-c-ag.html 704 css2.1/t140201-c534-bgreps-02-c-ag.html 705 css2.1/t140201-c534-bgreps-03-c-ag.html 706 css2.1/t140201-c534-bgreps-04-c-ag.html 707 css2.1/t140201-c534-bgreps-05-c-ag.html 708 css2.1/t140201-c535-bg-fixd-00-b-g.html 709 css2.1/t140201-c536-bgpos-00-b-ag.html 710 css2.1/t140201-c536-bgpos-01-b-ag.html 711 css2.1/t140201-c537-bgfxps-00-c-ag.html 712 css2.1/20110323/float-replaced-height-004.htm 713 css2.1/20110323/float-replaced-height-005.htm 714 css2.1/20110323/float-replaced-height-007.htm 693 715 css2.1/20110323/float-replaced-width-001.htm 694 716 css2.1/20110323/float-replaced-width-002.htm … … 696 718 css2.1/20110323/float-replaced-width-004.htm 697 719 css2.1/20110323/float-replaced-width-005.htm 720 css2.1/20110323/float-replaced-width-006.htm 698 721 css2.1/20110323/floats-001.html 699 722 css2.1/20110323/inline-block-non-replaced-width-001.htm 700 723 css2.1/20110323/inline-block-non-replaced-width-002.htm 724 css2.1/20110323/inline-block-replaced-height-001.htm 725 css2.1/20110323/inline-block-replaced-height-002.htm 726 css2.1/20110323/inline-block-replaced-height-004.htm 727 css2.1/20110323/inline-block-replaced-height-005.htm 728 css2.1/20110323/inline-block-replaced-height-007.htm 729 css2.1/20110323/inline-block-replaced-width-001.htm 701 730 css2.1/20110323/inline-box-002.htm 731 css2.1/20110323/inline-replaced-height-001.htm 732 css2.1/20110323/inline-replaced-height-002.htm 733 css2.1/20110323/inline-replaced-height-004.htm 734 css2.1/20110323/inline-replaced-height-005.htm 735 css2.1/20110323/inline-replaced-height-007.htm 702 736 css2.1/20110323/inline-replaced-width-011.htm 703 737 css2.1/20110323/inline-replaced-width-014.htm
Note: See TracChangeset
for help on using the changeset viewer.