Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-12 01:50:44 UTC (rev 226832)
@@ -1,5 +1,9 @@
2018-01-11 Jason Marcell <jmarc...@apple.com>
+ Revert r226221. rdar://problem/36167692
+
+2018-01-11 Jason Marcell <jmarc...@apple.com>
+
Revert r226237. rdar://problem/36183940
2018-01-11 Jason Marcell <jmarc...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/Sources.txt (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/Sources.txt 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/Sources.txt 2018-01-12 01:50:44 UTC (rev 226832)
@@ -1987,7 +1987,6 @@
rendering/updating/RenderTreeBuilderFirstLetter.cpp
rendering/updating/RenderTreeBuilderList.cpp
rendering/updating/RenderTreeBuilderMultiColumn.cpp
-rendering/updating/RenderTreeBuilderRuby.cpp
rendering/updating/RenderTreeBuilderTable.cpp
rendering/updating/RenderTreePosition.cpp
rendering/updating/RenderTreeUpdater.cpp
Modified: branches/safari-605-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-01-12 01:50:44 UTC (rev 226832)
@@ -391,7 +391,6 @@
112B34D51E60B98300BB310A /* SimpleLineLayoutPagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */; };
113D0B521F9FDD2B00F611BB /* LayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 113D0B501F9FDD2B00F611BB /* LayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
119340791FE8B92300935F1E /* RenderTreeBuilderTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340771FE8B92300935F1E /* RenderTreeBuilderTable.h */; };
- 1193408A1FEB355D00935F1E /* RenderTreeBuilderRuby.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340881FEB355D00935F1E /* RenderTreeBuilderRuby.h */; };
11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */; settings = {ATTRIBUTES = (Private, ); }; };
1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5583,8 +5582,6 @@
113D0B501F9FDD2B00F611BB /* LayoutContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutContext.h; sourceTree = "<group>"; };
119340761FE8B92300935F1E /* RenderTreeBuilderTable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderTable.cpp; sourceTree = "<group>"; };
119340771FE8B92300935F1E /* RenderTreeBuilderTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderTable.h; sourceTree = "<group>"; };
- 119340871FEB355D00935F1E /* RenderTreeBuilderRuby.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderRuby.cpp; sourceTree = "<group>"; };
- 119340881FEB355D00935F1E /* RenderTreeBuilderRuby.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderRuby.h; sourceTree = "<group>"; };
11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutCoverage.cpp; sourceTree = "<group>"; };
11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutCoverage.h; sourceTree = "<group>"; };
1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappableInlines.h; sourceTree = "<group>"; };
@@ -24629,8 +24626,6 @@
E47C39281FE6E0DD00BBBC6B /* RenderTreeBuilderList.h */,
E47C39231FE6E0DA00BBBC6B /* RenderTreeBuilderMultiColumn.cpp */,
E47C39271FE6E0DC00BBBC6B /* RenderTreeBuilderMultiColumn.h */,
- 119340871FEB355D00935F1E /* RenderTreeBuilderRuby.cpp */,
- 119340881FEB355D00935F1E /* RenderTreeBuilderRuby.h */,
119340761FE8B92300935F1E /* RenderTreeBuilderTable.cpp */,
119340771FE8B92300935F1E /* RenderTreeBuilderTable.h */,
E47C39291FE6E0DE00BBBC6B /* RenderTreePosition.cpp */,
@@ -27353,6 +27348,7 @@
977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */,
0707568C142262D600414161 /* HTMLTrackElement.h in Headers */,
977B37261228721700B81FF8 /* HTMLTreeBuilder.h in Headers */,
+ E47C39301FE6E0FD00BBBC6B /* RenderTreeBuilderFirstLetter.h in Headers */,
A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */,
AD49914318F0815100BF0092 /* HTMLUnknownElement.h in Headers */,
E44613AB0CD6331000FADA75 /* HTMLVideoElement.h in Headers */,
@@ -29049,14 +29045,12 @@
BCEA4887097D93020094C9E4 /* RenderThemeMac.h in Headers */,
93F1998C08245E59001E9ABC /* RenderTreeAsText.h in Headers */,
E47C392D1FE6E0F300BBBC6B /* RenderTreeBuilder.h in Headers */,
- E47C39301FE6E0FD00BBBC6B /* RenderTreeBuilderFirstLetter.h in Headers */,
- E47C39321FE6E10500BBBC6B /* RenderTreeBuilderList.h in Headers */,
- E47C39331FE6E10800BBBC6B /* RenderTreeBuilderMultiColumn.h in Headers */,
- 1193408A1FEB355D00935F1E /* RenderTreeBuilderRuby.h in Headers */,
119340791FE8B92300935F1E /* RenderTreeBuilderTable.h in Headers */,
E47C392E1FE6E0F700BBBC6B /* RenderTreePosition.h in Headers */,
E47C392F1FE6E0F900BBBC6B /* RenderTreeUpdater.h in Headers */,
E47C39311FE6E10200BBBC6B /* RenderTreeUpdaterGeneratedContent.h in Headers */,
+ E47C39321FE6E10500BBBC6B /* RenderTreeBuilderList.h in Headers */,
+ E47C39331FE6E10800BBBC6B /* RenderTreeBuilderMultiColumn.h in Headers */,
E44614520CD68A3500FADA75 /* RenderVideo.h in Headers */,
BCEA4868097D93020094C9E4 /* RenderView.h in Headers */,
BE20507E18A458C20080647E /* RenderVTTCue.h in Headers */,
Modified: branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-01-12 01:50:44 UTC (rev 226832)
@@ -35,7 +35,6 @@
#include "RenderTreeBuilderFirstLetter.h"
#include "RenderTreeBuilderList.h"
#include "RenderTreeBuilderMultiColumn.h"
-#include "RenderTreeBuilderRuby.h"
#include "RenderTreeBuilderTable.h"
namespace WebCore {
@@ -48,7 +47,6 @@
, m_listBuilder(std::make_unique<List>(*this))
, m_multiColumnBuilder(std::make_unique<MultiColumn>(*this))
, m_tableBuilder(std::make_unique<Table>(*this))
- , m_rubyBuilder(std::make_unique<Ruby>(*this))
{
RELEASE_ASSERT(!s_current || &m_view != &s_current->m_view);
m_previous = s_current;
@@ -100,7 +98,7 @@
}
if (is<RenderRubyRun>(parent)) {
- rubyBuilder().insertChild(downcast<RenderRubyRun>(parent), WTFMove(child), beforeChild);
+ rubyRunInsertChild(downcast<RenderRubyRun>(parent), WTFMove(child), beforeChild);
return;
}
@@ -122,4 +120,51 @@
multiColumnBuilder().updateAfterDescendants(downcast<RenderBlockFlow>(renderer));
}
+void RenderTreeBuilder::rubyRunInsertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+{
+ if (child->isRubyText()) {
+ if (!beforeChild) {
+ // RenderRuby has already ascertained that we can add the child here.
+ ASSERT(!parent.hasRubyText());
+ // prepend ruby texts as first child
+ parent.addChild(*this, WTFMove(child), parent.firstChild());
+ return;
+ }
+ if (beforeChild->isRubyText()) {
+ // New text is inserted just before another.
+ // In this case the new text takes the place of the old one, and
+ // the old text goes into a new run that is inserted as next sibling.
+ ASSERT(beforeChild->parent() == &parent);
+ RenderElement* ruby = parent.parent();
+ ASSERT(isRuby(ruby));
+ auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
+ insertChild(*ruby, WTFMove(newRun), parent.nextSibling());
+ // Add the new ruby text and move the old one to the new run
+ // Note: Doing it in this order and not using RenderRubyRun's methods,
+ // in order to avoid automatic removal of the ruby run in case there is no
+ // other child besides the old ruby text.
+ parent.addChild(*this, WTFMove(child), beforeChild);
+ auto takenBeforeChild = parent.RenderBlockFlow::takeChild(*beforeChild);
+ insertChild(*newRun, WTFMove(takenBeforeChild));
+ return;
+ }
+ if (parent.hasRubyBase()) {
+ // Insertion before a ruby base object.
+ // In this case we need insert a new run before the current one and split the base.
+ RenderElement* ruby = parent.parent();
+ auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
+ auto& run = *newRun;
+ insertChild(*ruby, WTFMove(newRun), &parent);
+ insertChild(run, WTFMove(child));
+ parent.rubyBaseSafe()->moveChildren(run.rubyBaseSafe(), beforeChild);
+ }
+ return;
+ }
+ // child is not a text -> insert it into the base
+ // (append it instead if beforeChild is the ruby text)
+ if (beforeChild && beforeChild->isRubyText())
+ beforeChild = nullptr;
+ insertChild(*parent.rubyBaseSafe(), WTFMove(child), beforeChild);
}
+
+}
Modified: branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.h (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-01-12 01:50:44 UTC (rev 226832)
@@ -51,13 +51,13 @@
class List;
class MultiColumn;
class Table;
- class Ruby;
+ void rubyRunInsertChild(RenderRubyRun&, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+
FirstLetter& firstLetterBuilder() { return *m_firstLetterBuilder; }
List& listBuilder() { return *m_listBuilder; }
MultiColumn& multiColumnBuilder() { return *m_multiColumnBuilder; }
Table& tableBuilder() { return *m_tableBuilder; }
- Ruby& rubyBuilder() { return *m_rubyBuilder; }
RenderView& m_view;
@@ -68,8 +68,6 @@
std::unique_ptr<List> m_listBuilder;
std::unique_ptr<MultiColumn> m_multiColumnBuilder;
std::unique_ptr<Table> m_tableBuilder;
- std::unique_ptr<Ruby> m_rubyBuilder;
};
}
-
Deleted: branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp 2018-01-12 01:50:44 UTC (rev 226832)
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RenderTreeBuilderRuby.h"
-
-#include "RenderTreeBuilder.h"
-
-namespace WebCore {
-
-RenderTreeBuilder::Ruby::Ruby(RenderTreeBuilder& builder)
- : m_builder(builder)
-{
-}
-
-void RenderTreeBuilder::Ruby::insertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
- if (child->isRubyText()) {
- if (!beforeChild) {
- // RenderRuby has already ascertained that we can add the child here.
- ASSERT(!parent.hasRubyText());
- // prepend ruby texts as first child
- parent.addChild(m_builder, WTFMove(child), parent.firstChild());
- return;
- }
- if (beforeChild->isRubyText()) {
- // New text is inserted just before another.
- // In this case the new text takes the place of the old one, and
- // the old text goes into a new run that is inserted as next sibling.
- ASSERT(beforeChild->parent() == &parent);
- RenderElement* ruby = parent.parent();
- ASSERT(isRuby(ruby));
- auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
- m_builder.insertChild(*ruby, WTFMove(newRun), parent.nextSibling());
- // Add the new ruby text and move the old one to the new run
- // Note: Doing it in this order and not using RenderRubyRun's methods,
- // in order to avoid automatic removal of the ruby run in case there is no
- // other child besides the old ruby text.
- parent.addChild(m_builder, WTFMove(child), beforeChild);
- auto takenBeforeChild = parent.RenderBlockFlow::takeChild(*beforeChild);
- m_builder.insertChild(*newRun, WTFMove(takenBeforeChild));
- return;
- }
- if (parent.hasRubyBase()) {
- // Insertion before a ruby base object.
- // In this case we need insert a new run before the current one and split the base.
- RenderElement* ruby = parent.parent();
- auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
- auto& run = *newRun;
- m_builder.insertChild(*ruby, WTFMove(newRun), &parent);
- m_builder.insertChild(run, WTFMove(child));
- parent.rubyBaseSafe()->moveChildren(run.rubyBaseSafe(), beforeChild);
- }
- return;
- }
- // child is not a text -> insert it into the base
- // (append it instead if beforeChild is the ruby text)
- if (beforeChild && beforeChild->isRubyText())
- beforeChild = nullptr;
- m_builder.insertChild(*parent.rubyBaseSafe(), WTFMove(child), beforeChild);
-}
-
-}
-
Deleted: branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h (226831 => 226832)
--- branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h 2018-01-12 01:50:41 UTC (rev 226831)
+++ branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h 2018-01-12 01:50:44 UTC (rev 226832)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderTreeUpdater.h"
-
-namespace WebCore {
-
-class RenderObject;
-class RenderRubyRun;
-class RenderTreeBuilder;
-
-class RenderTreeBuilder::Ruby {
-public:
- Ruby(RenderTreeBuilder&);
-
- void insertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-
-private:
- RenderTreeBuilder& m_builder;
-};
-
-}
-