| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Ignore the text of non-visible frames. | 65 // Ignore the text of non-visible frames. |
| 66 LayoutViewItem contentLayoutItem = curLocalChild->contentLayoutItem(); | 66 LayoutViewItem contentLayoutItem = curLocalChild->contentLayoutItem(); |
| 67 LayoutPartItem ownerLayoutItem = curLocalChild->ownerLayoutItem(); | 67 LayoutPartItem ownerLayoutItem = curLocalChild->ownerLayoutItem(); |
| 68 if (contentLayoutItem.isNull() || !contentLayoutItem.size().width() || | 68 if (contentLayoutItem.isNull() || !contentLayoutItem.size().width() || |
| 69 !contentLayoutItem.size().height() || | 69 !contentLayoutItem.size().height() || |
| 70 (contentLayoutItem.location().x() + contentLayoutItem.size().width() <= | 70 (contentLayoutItem.location().x() + contentLayoutItem.size().width() <= |
| 71 0) || | 71 0) || |
| 72 (contentLayoutItem.location().y() + contentLayoutItem.size().height() <= | 72 (contentLayoutItem.location().y() + contentLayoutItem.size().height() <= |
| 73 0) || | 73 0) || |
| 74 (!ownerLayoutItem.isNull() && ownerLayoutItem.style() && | 74 (!ownerLayoutItem.isNull() && ownerLayoutItem.style() && |
| 75 ownerLayoutItem.style()->visibility() != EVisibility::Visible)) { | 75 ownerLayoutItem.style()->visibility() != EVisibility::kVisible)) { |
| 76 continue; | 76 continue; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Make sure the frame separator won't fill up the buffer, and give up if | 79 // Make sure the frame separator won't fill up the buffer, and give up if |
| 80 // it will. The danger is if the separator will make the buffer longer than | 80 // it will. The danger is if the separator will make the buffer longer than |
| 81 // maxChars. This will cause the computation above: | 81 // maxChars. This will cause the computation above: |
| 82 // maxChars - output->size() | 82 // maxChars - output->size() |
| 83 // to be a negative number which will crash when the subframe is added. | 83 // to be a negative number which will crash when the subframe is added. |
| 84 if (output.length() >= maxChars - frameSeparatorLength) | 84 if (output.length() >= maxChars - frameSeparatorLength) |
| 85 return; | 85 return; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |