Title: [202454] trunk/Source
Revision
202454
Author
[email protected]
Date
2016-06-24 15:25:10 -0700 (Fri, 24 Jun 2016)

Log Message

Include enclosingListType in EditorState
https://bugs.webkit.org/show_bug.cgi?id=159102
-and corresponding-
rdar://problem/26932490

Reviewed by Enrica Casucci.

Source/WebCore:

Make HTMLOListElement.h and HTMLUListElement.h Private instead of Project.
* WebCore.xcodeproj/project.pbxproj:

Export enclosingList(Node*)
* editing/htmlediting.h:

Source/WebKit2:

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202453 => 202454)


--- trunk/Source/WebCore/ChangeLog	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebCore/ChangeLog	2016-06-24 22:25:10 UTC (rev 202454)
@@ -1,3 +1,18 @@
+2016-06-24  Beth Dakin  <[email protected]>
+
+        Include enclosingListType in EditorState
+        https://bugs.webkit.org/show_bug.cgi?id=159102
+        -and corresponding-
+        rdar://problem/26932490
+
+        Reviewed by Enrica Casucci.
+
+        Make HTMLOListElement.h and HTMLUListElement.h Private instead of Project.
+        * WebCore.xcodeproj/project.pbxproj:
+
+        Export enclosingList(Node*)
+        * editing/htmlediting.h:
+
 2016-06-24  Anders Carlsson  <[email protected]>
 
         Another Windows build fix.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202453 => 202454)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-06-24 22:25:10 UTC (rev 202454)
@@ -4648,8 +4648,8 @@
 		A8DF4AF10980C42C0052981B /* RenderTableCol.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF4AE70980C42C0052981B /* RenderTableCol.h */; };
 		A8EA73C30A1900E300A8EF5F /* RenderFieldset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73AF0A1900E300A8EF5F /* RenderFieldset.cpp */; };
 		A8EA73C40A1900E300A8EF5F /* RenderFieldset.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B00A1900E300A8EF5F /* RenderFieldset.h */; };
-		A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */; };
-		A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E60A1916DF00A8EF5F /* HTMLUListElement.h */; };
+		A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E60A1916DF00A8EF5F /* HTMLUListElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA79E70A1916DF00A8EF5F /* HTMLUListElement.cpp */; };
 		A8EA79F40A1916DF00A8EF5F /* HTMLMenuElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E80A1916DF00A8EF5F /* HTMLMenuElement.h */; };
 		A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA79E90A1916DF00A8EF5F /* HTMLDListElement.cpp */; };

Modified: trunk/Source/WebCore/editing/htmlediting.h (202453 => 202454)


--- trunk/Source/WebCore/editing/htmlediting.h	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebCore/editing/htmlediting.h	2016-06-24 22:25:10 UTC (rev 202454)
@@ -158,7 +158,7 @@
 Ref<HTMLElement> createHTMLElement(Document&, const QualifiedName&);
 Ref<HTMLElement> createHTMLElement(Document&, const AtomicString&);
 
-HTMLElement* enclosingList(Node*);
+WEBCORE_EXPORT HTMLElement* enclosingList(Node*);
 HTMLElement* outermostEnclosingList(Node*, Node* rootList = nullptr);
 Node* enclosingListChild(Node*);
 

Modified: trunk/Source/WebKit2/ChangeLog (202453 => 202454)


--- trunk/Source/WebKit2/ChangeLog	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-24 22:25:10 UTC (rev 202454)
@@ -1,3 +1,19 @@
+2016-06-24  Beth Dakin  <[email protected]>
+
+        Include enclosingListType in EditorState
+        https://bugs.webkit.org/show_bug.cgi?id=159102
+        -and corresponding-
+        rdar://problem/26932490
+
+        Reviewed by Enrica Casucci.
+
+        * Shared/EditorState.cpp:
+        (WebKit::EditorState::PostLayoutData::encode):
+        (WebKit::EditorState::PostLayoutData::decode):
+        * Shared/EditorState.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::editorState):
+
 2016-06-24  Anders Carlsson  <[email protected]>
 
         Inline more of the Apple Pay source code

Modified: trunk/Source/WebKit2/Shared/EditorState.cpp (202453 => 202454)


--- trunk/Source/WebKit2/Shared/EditorState.cpp	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebKit2/Shared/EditorState.cpp	2016-06-24 22:25:10 UTC (rev 202454)
@@ -115,6 +115,7 @@
     encoder << selectedTextLength;
     encoder << textAlignment;
     encoder << textColor;
+    encoder << enclosingListType;
 #endif
 #if PLATFORM(IOS)
     encoder << caretRectAtEnd;
@@ -150,6 +151,8 @@
         return false;
     if (!decoder.decode(result.textColor))
         return false;
+    if (!decoder.decode(result.enclosingListType))
+        return false;
 #endif
 #if PLATFORM(IOS)
     if (!decoder.decode(result.caretRectAtEnd))

Modified: trunk/Source/WebKit2/Shared/EditorState.h (202453 => 202454)


--- trunk/Source/WebKit2/Shared/EditorState.h	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebKit2/Shared/EditorState.h	2016-06-24 22:25:10 UTC (rev 202454)
@@ -53,6 +53,12 @@
     JustifiedAlignment = 4,
 };
 
+enum ListType {
+    NoList = 0,
+    OrderedList,
+    UnorderedList
+};
+
 struct EditorState {
     bool shouldIgnoreCompositionSelectionChange { false };
 
@@ -82,6 +88,7 @@
         uint64_t selectedTextLength { 0 };
         uint32_t textAlignment { NoAlignment };
         WebCore::Color textColor { WebCore::Color::black };
+        uint32_t enclosingListType { NoList };
 #endif
 #if PLATFORM(IOS)
         WebCore::IntRect caretRectAtEnd;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (202453 => 202454)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-06-24 22:00:29 UTC (rev 202453)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-06-24 22:25:10 UTC (rev 202454)
@@ -130,8 +130,10 @@
 #include <WebCore/HTMLFormElement.h>
 #include <WebCore/HTMLImageElement.h>
 #include <WebCore/HTMLInputElement.h>
+#include <WebCore/HTMLOListElement.h>
 #include <WebCore/HTMLPlugInElement.h>
 #include <WebCore/HTMLPlugInImageElement.h>
+#include <WebCore/HTMLUListElement.h>
 #include <WebCore/HistoryController.h>
 #include <WebCore/HistoryItem.h>
 #include <WebCore/HitTestResult.h>
@@ -169,6 +171,7 @@
 #include <WebCore/UserStyleSheet.h>
 #include <WebCore/VisiblePosition.h>
 #include <WebCore/VisibleUnits.h>
+#include <WebCore/htmlediting.h>
 #include <WebCore/markup.h>
 #include <bindings/ScriptValue.h>
 #include <profiler/ProfilerDatabase.h>
@@ -867,6 +870,17 @@
                     postLayoutData.textAlignment = style->isLeftToRightDirection() ? RightAlignment : LeftAlignment;
                     break;
                 }
+                
+                HTMLElement* enclosingListElement = enclosingList(selection.start().deprecatedNode());
+                if (enclosingListElement) {
+                    if (is<HTMLUListElement>(*enclosingListElement))
+                        postLayoutData.enclosingListType = UnorderedList;
+                    else if (is<HTMLOListElement>(*enclosingListElement))
+                        postLayoutData.enclosingListType = OrderedList;
+                    else
+                        ASSERT_NOT_REACHED();
+                } else
+                    postLayoutData.enclosingListType = NoList;
 
                 if (nodeToRemove)
                     nodeToRemove->remove(ASSERT_NO_EXCEPTION);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to