Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: third_party/WebKit/Source/web/WebFrameContentDumper.cpp

Issue 2389633002: reflow comments in web/ (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/web/WebFrameContentDumper.h" 5 #include "public/web/WebFrameContentDumper.h"
6 6
7 #include "core/editing/EphemeralRange.h" 7 #include "core/editing/EphemeralRange.h"
8 #include "core/editing/iterators/TextIterator.h" 8 #include "core/editing/iterators/TextIterator.h"
9 #include "core/editing/serializers/Serialization.h" 9 #include "core/editing/serializers/Serialization.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 21 matching lines...) Expand all
32 32
33 DCHECK(!frame->view()->needsLayout()); 33 DCHECK(!frame->view()->needsLayout());
34 DCHECK(!document->needsLayoutTreeUpdate()); 34 DCHECK(!document->needsLayoutTreeUpdate());
35 35
36 // Select the document body. 36 // Select the document body.
37 if (document->body()) { 37 if (document->body()) {
38 const EphemeralRange range = 38 const EphemeralRange range =
39 EphemeralRange::rangeOfContents(*document->body()); 39 EphemeralRange::rangeOfContents(*document->body());
40 40
41 // The text iterator will walk nodes giving us text. This is similar to 41 // The text iterator will walk nodes giving us text. This is similar to
42 // the plainText() function in core/editing/TextIterator.h, but we implement the maximum 42 // the plainText() function in core/editing/TextIterator.h, but we
43 // size and also copy the results directly into a wstring, avoiding the 43 // implement the maximum size and also copy the results directly into a
44 // string conversion. 44 // wstring, avoiding the string conversion.
45 for (TextIterator it(range.startPosition(), range.endPosition()); 45 for (TextIterator it(range.startPosition(), range.endPosition());
46 !it.atEnd(); it.advance()) { 46 !it.atEnd(); it.advance()) {
47 it.text().appendTextToStringBuilder(output, 0, 47 it.text().appendTextToStringBuilder(output, 0,
48 maxChars - output.length()); 48 maxChars - output.length());
49 if (output.length() >= maxChars) 49 if (output.length() >= maxChars)
50 return; // Filled up the buffer. 50 return; // Filled up the buffer.
51 } 51 }
52 } 52 }
53 53
54 // The separator between frames when the frames are converted to plain text. 54 // The separator between frames when the frames are converted to plain text.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (toShow & LayoutAsTextDebug) 128 if (toShow & LayoutAsTextDebug)
129 behavior |= LayoutAsTextShowCompositedLayers | LayoutAsTextShowAddresses | 129 behavior |= LayoutAsTextShowCompositedLayers | LayoutAsTextShowAddresses |
130 LayoutAsTextShowIDAndClass | LayoutAsTextShowLayerNesting; 130 LayoutAsTextShowIDAndClass | LayoutAsTextShowLayerNesting;
131 131
132 if (toShow & LayoutAsTextPrinting) 132 if (toShow & LayoutAsTextPrinting)
133 behavior |= LayoutAsTextPrintingMode; 133 behavior |= LayoutAsTextPrintingMode;
134 134
135 return externalRepresentation(toWebLocalFrameImpl(frame)->frame(), behavior); 135 return externalRepresentation(toWebLocalFrameImpl(frame)->frame(), behavior);
136 } 136 }
137 } 137 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/Source/web/WebFrameImplBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698