Skip to content
Permalink
Browse files
[LFC][Integration] Remove ensureLineBoxes call from RenderedPosition …
…constructor

https://bugs.webkit.org/show_bug.cgi?id=219164

Reviewed by Zalan Bujtas.

Source/WebCore:

It is not needed anymore. We can use LFC line layout through the editing code.

* dom/Position.cpp:
(WebCore::Position::ensureLineBoxes const): Deleted.
* dom/Position.h:
* editing/RenderedPosition.cpp:
(WebCore::RenderedPosition::RenderedPosition):
* editing/RenderedPosition.h:
(WebCore::RenderedPosition::rootBox): Deleted.

LayoutTests:

* accessibility/mac/attachment-element-replacement-character-expected.txt:
* platform/ios/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:


Canonical link: https://commits.webkit.org/231859@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed Nov 21, 2020
1 parent 93cc6c3 commit e907ec6142c39e226435e6659c79fccba42b17f3
Showing 8 changed files with 31 additions and 26 deletions.
@@ -1,3 +1,13 @@
2020-11-21 Antti Koivisto <antti@apple.com>

[LFC][Integration] Remove ensureLineBoxes call from RenderedPosition constructor
https://bugs.webkit.org/show_bug.cgi?id=219164

Reviewed by Zalan Bujtas.

* accessibility/mac/attachment-element-replacement-character-expected.txt:
* platform/ios/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:

2020-11-21 Brian Burg <bburg@apple.com>

Web Inspector: implement Multimap.prototype.take()
@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE


String:
some[ATTACHMENT] test
some [ATTACHMENT] test
This tests that attachment element replacements are present in strings.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -21,13 +21,11 @@ layer at (0,0) size 800x600
RenderBlock {HR} at (0,92) size 784x2 [border: (1px inset #000000)]
RenderBlock {HR} at (0,198) size 784x2 [border: (1px inset #000000)]
RenderBlock {PRE} at (0,213) size 108x78 [border: (4px solid #0000FF)]
RenderText {#text} at (4,4) size 100x70
text run at (4,4) width 86: "This text"
text run at (89,4) width 15: " "
RenderText {#text} at (4,4) size 94x70
text run at (4,4) width 86: "This text "
text run at (4,18) width 71: "will wrap"
text run at (74,18) width 1: " "
text run at (4,32) width 71: "and fit"
text run at (74,32) width 24: " "
text run at (4,32) width 94: "and fit "
text run at (4,46) width 79: "within the"
text run at (82,46) width 1: " "
text run at (4,60) width 32: "box."
@@ -1,3 +1,20 @@
2020-11-21 Antti Koivisto <antti@apple.com>

[LFC][Integration] Remove ensureLineBoxes call from RenderedPosition constructor
https://bugs.webkit.org/show_bug.cgi?id=219164

Reviewed by Zalan Bujtas.

It is not needed anymore. We can use LFC line layout through the editing code.

* dom/Position.cpp:
(WebCore::Position::ensureLineBoxes const): Deleted.
* dom/Position.h:
* editing/RenderedPosition.cpp:
(WebCore::RenderedPosition::RenderedPosition):
* editing/RenderedPosition.h:
(WebCore::RenderedPosition::rootBox): Deleted.

2020-11-21 Aditya Keerthi <akeerthi@apple.com>

Space between minute and meridiem fields in time inputs is too large
@@ -1363,19 +1363,6 @@ InlineRunAndOffset Position::inlineRunAndOffset(Affinity affinity, TextDirection
return { run, caretOffset };
}

void Position::ensureLineBoxes() const
{
auto node = deprecatedNode();
if (!node)
return;
auto renderer = node->renderer();
if (!renderer)
return;
auto* parent = renderer->parent();
if (is<RenderBlockFlow>(parent))
downcast<RenderBlockFlow>(*parent).ensureLineBoxes();
}

TextDirection Position::primaryDirection() const
{
if (!m_anchorNode || !m_anchorNode->renderer())
@@ -199,8 +199,6 @@ class Position {
// FIXME: Combine this function with operator==
bool equals(const Position&) const;

void ensureLineBoxes() const;

private:
// For creating legacy editing positions: (Anchor type will be determined from editingIgnoresContent(node))
enum class LegacyEditingPositionFlag { On };
@@ -85,9 +85,6 @@ RenderedPosition::RenderedPosition(const Position& position, Affinity affinity)
if (position.isNull())
return;

// FIXME: Remove.
position.ensureLineBoxes();

auto runAndOffset = position.inlineRunAndOffset(affinity);
m_run = runAndOffset.run;
m_offset = runAndOffset.offset;
@@ -51,8 +51,6 @@ class RenderedPosition {
bool isNull() const { return !m_renderer; }
LayoutIntegration::LineIterator line() const { return m_run ? m_run.line() : LayoutIntegration::LineIterator(); }

RootInlineBox* rootBox() { return m_run ? &m_run->legacyInlineBox()->root() : nullptr; }

unsigned char bidiLevelOnLeft() const;
unsigned char bidiLevelOnRight() const;
RenderedPosition leftBoundaryOfBidiRun(unsigned char bidiLevelOfRun);

0 comments on commit e907ec6

Please sign in to comment.