Changeset 225651 in webkit
- Timestamp:
- Dec 7, 2017 4:15:29 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r225646 r225651 1 2017-12-07 Simon Fraser <simon.fraser@apple.com> 2 3 Add logging for EditorState in RemoteLayerTree transactions 4 https://bugs.webkit.org/show_bug.cgi?id=180515 5 6 Reviewed by Wenson Hsieh. 7 8 Make EditorState TextStream-able, and dump it in layer tree transactions. 9 10 * Shared/EditorState.cpp: 11 (WebKit::operator<<): 12 * Shared/EditorState.h: 13 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: 14 (WebKit::RemoteLayerTreeTransaction::description const): 15 1 16 2017-12-07 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebKit/Shared/EditorState.cpp
r224945 r225651 28 28 29 29 #include "WebCoreArgumentCoders.h" 30 #include <wtf/text/TextStream.h> 31 32 using namespace WebCore; 30 33 31 34 namespace WebKit { … … 203 206 } 204 207 205 } 208 TextStream& operator<<(TextStream& ts, const EditorState& editorState) 209 { 210 #if PLATFORM(IOS) 211 if (editorState.firstMarkedRect != IntRect()) 212 ts.dumpProperty("firstMarkedRect", editorState.firstMarkedRect); 213 if (editorState.lastMarkedRect != IntRect()) 214 ts.dumpProperty("lastMarkedRect", editorState.lastMarkedRect); 215 if (editorState.markedText.length()) 216 ts.dumpProperty("markedText", editorState.markedText); 217 #endif 218 219 if (editorState.shouldIgnoreSelectionChanges) 220 ts.dumpProperty("shouldIgnoreSelectionChanges", editorState.shouldIgnoreSelectionChanges); 221 if (!editorState.selectionIsNone) 222 ts.dumpProperty("selectionIsNone", editorState.selectionIsNone); 223 if (editorState.selectionIsRange) 224 ts.dumpProperty("selectionIsRange", editorState.selectionIsRange); 225 if (editorState.isContentEditable) 226 ts.dumpProperty("isContentEditable", editorState.isContentEditable); 227 if (editorState.isContentRichlyEditable) 228 ts.dumpProperty("isContentRichlyEditable", editorState.isContentRichlyEditable); 229 if (editorState.isInPasswordField) 230 ts.dumpProperty("isInPasswordField", editorState.isInPasswordField); 231 if (editorState.isInPlugin) 232 ts.dumpProperty("isInPlugin", editorState.isInPlugin); 233 if (editorState.hasComposition) 234 ts.dumpProperty("hasComposition", editorState.hasComposition); 235 if (editorState.isMissingPostLayoutData) 236 ts.dumpProperty("isMissingPostLayoutData", editorState.isMissingPostLayoutData); 237 238 if (editorState.isMissingPostLayoutData) 239 return ts; 240 241 TextStream::GroupScope scope(ts); 242 ts << "postLayoutData"; 243 if (editorState.postLayoutData().typingAttributes != AttributeNone) 244 ts.dumpProperty("typingAttributes", editorState.postLayoutData().typingAttributes); 245 #if PLATFORM(IOS) || PLATFORM(GTK) 246 if (editorState.postLayoutData().caretRectAtStart != IntRect()) 247 ts.dumpProperty("caretRectAtStart", editorState.postLayoutData().caretRectAtStart); 248 #endif 249 #if PLATFORM(IOS) || PLATFORM(MAC) 250 if (editorState.postLayoutData().selectionClipRect != IntRect()) 251 ts.dumpProperty("selectionClipRect", editorState.postLayoutData().selectionClipRect); 252 if (editorState.postLayoutData().selectedTextLength) 253 ts.dumpProperty("selectedTextLength", editorState.postLayoutData().selectedTextLength); 254 if (editorState.postLayoutData().textAlignment != NoAlignment) 255 ts.dumpProperty("textAlignment", editorState.postLayoutData().textAlignment); 256 if (editorState.postLayoutData().textColor.isValid()) 257 ts.dumpProperty("textColor", editorState.postLayoutData().textColor); 258 if (editorState.postLayoutData().enclosingListType != NoList) 259 ts.dumpProperty("enclosingListType", editorState.postLayoutData().enclosingListType); 260 #endif 261 #if PLATFORM(IOS) 262 if (editorState.postLayoutData().caretRectAtEnd != IntRect()) 263 ts.dumpProperty("caretRectAtEnd", editorState.postLayoutData().caretRectAtEnd); 264 if (editorState.postLayoutData().selectionRects.size()) 265 ts.dumpProperty("selectionRects", editorState.postLayoutData().selectionRects); 266 if (editorState.postLayoutData().wordAtSelection.length()) 267 ts.dumpProperty("wordAtSelection", editorState.postLayoutData().wordAtSelection); 268 if (editorState.postLayoutData().characterAfterSelection) 269 ts.dumpProperty("characterAfterSelection", editorState.postLayoutData().characterAfterSelection); 270 if (editorState.postLayoutData().characterBeforeSelection) 271 ts.dumpProperty("characterBeforeSelection", editorState.postLayoutData().characterBeforeSelection); 272 if (editorState.postLayoutData().twoCharacterBeforeSelection) 273 ts.dumpProperty("twoCharacterBeforeSelection", editorState.postLayoutData().twoCharacterBeforeSelection); 274 275 if (editorState.postLayoutData().isReplaceAllowed) 276 ts.dumpProperty("isReplaceAllowed", editorState.postLayoutData().isReplaceAllowed); 277 if (editorState.postLayoutData().hasContent) 278 ts.dumpProperty("hasContent", editorState.postLayoutData().hasContent); 279 ts.dumpProperty("isStableStateUpdate", editorState.postLayoutData().isStableStateUpdate); 280 if (editorState.postLayoutData().insideFixedPosition) 281 ts.dumpProperty("insideFixedPosition", editorState.postLayoutData().insideFixedPosition); 282 if (editorState.postLayoutData().caretColor.isValid()) 283 ts.dumpProperty("caretColor", editorState.postLayoutData().caretColor); 284 #endif 285 #if PLATFORM(MAC) 286 if (editorState.postLayoutData().candidateRequestStartPosition) 287 ts.dumpProperty("candidateRequestStartPosition", editorState.postLayoutData().candidateRequestStartPosition); 288 if (editorState.postLayoutData().paragraphContextForCandidateRequest.length()) 289 ts.dumpProperty("paragraphContextForCandidateRequest", editorState.postLayoutData().paragraphContextForCandidateRequest); 290 if (editorState.postLayoutData().stringForCandidateRequest.length()) 291 ts.dumpProperty("stringForCandidateRequest", editorState.postLayoutData().stringForCandidateRequest); 292 #endif 293 294 if (editorState.postLayoutData().canCut) 295 ts.dumpProperty("canCut", editorState.postLayoutData().canCut); 296 if (editorState.postLayoutData().canCopy) 297 ts.dumpProperty("canCopy", editorState.postLayoutData().canCopy); 298 if (editorState.postLayoutData().canPaste) 299 ts.dumpProperty("canPaste", editorState.postLayoutData().canPaste); 300 301 return ts; 302 } 303 304 } // namespace WebKit -
trunk/Source/WebKit/Shared/EditorState.h
r224945 r225651 24 24 */ 25 25 26 #ifndef EditorState_h 27 #define EditorState_h 26 #pragma once 28 27 29 28 #include "ArgumentCoders.h" … … 35 34 #include <WebCore/SelectionRect.h> 36 35 #endif 36 37 namespace WTF { 38 class TextStream; 39 }; 37 40 38 41 namespace WebKit { … … 140 143 } 141 144 142 } 145 WTF::TextStream& operator<<(WTF::TextStream&, const EditorState&); 143 146 144 #endif // EditorState_h 147 } // namespace WebKit -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
r223149 r225651 906 906 ts.dumpProperty("isInStableState", m_isInStableState); 907 907 ts.dumpProperty("renderTreeSize", m_renderTreeSize); 908 909 ts << "root-layer " << m_rootLayerID << ")"; 908 ts.dumpProperty("root-layer", m_rootLayerID); 910 909 911 910 if (!m_createdLayers.isEmpty()) { … … 936 935 ts.dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>("destroyed-layers", m_destroyedLayerIDs); 937 936 937 if (m_editorState) { 938 TextStream::GroupScope scope(ts); 939 ts << "EditorState"; 940 ts << *m_editorState; 941 } 942 938 943 ts.endGroup(); 939 944
Note: See TracChangeset
for help on using the changeset viewer.