OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "DocumentStatisticsCollector.h" | 5 #include "DocumentStatisticsCollector.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/InputTypeNames.h" | 8 #include "core/InputTypeNames.h" |
9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
10 #include "core/dom/NodeComputedStyle.h" | 10 #include "core/dom/NodeComputedStyle.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 return length; | 57 return length; |
58 } | 58 } |
59 | 59 |
60 bool isVisible(const Element& element) | 60 bool isVisible(const Element& element) |
61 { | 61 { |
62 const ComputedStyle* style = element.computedStyle(); | 62 const ComputedStyle* style = element.computedStyle(); |
63 if (!style) | 63 if (!style) |
64 return false; | 64 return false; |
65 return ( | 65 return ( |
66 style->display() != NONE | 66 style->display() != EDisplay::None |
67 && style->visibility() != EVisibility::Hidden | 67 && style->visibility() != EVisibility::Hidden |
68 && style->opacity() != 0 | 68 && style->opacity() != 0 |
69 ); | 69 ); |
70 } | 70 } |
71 | 71 |
72 bool matchAttributes(const Element& element, const Vector<String>& words) | 72 bool matchAttributes(const Element& element, const Vector<String>& words) |
73 { | 73 { |
74 const String& classes = element.getClassAttribute(); | 74 const String& classes = element.getClassAttribute(); |
75 const String& id = element.getIdAttribute(); | 75 const String& id = element.getIdAttribute(); |
76 for (const String& word : words) { | 76 for (const String& word : words) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 double elapsedTime = monotonicallyIncreasingTime() - startTime; | 246 double elapsedTime = monotonicallyIncreasingTime() - startTime; |
247 | 247 |
248 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram, ("WebCore
.DistillabilityUs", 1, 1000000, 50)); | 248 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram, ("WebCore
.DistillabilityUs", 1, 1000000, 50)); |
249 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime)); | 249 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime)); |
250 | 250 |
251 return features; | 251 return features; |
252 } | 252 } |
253 | 253 |
254 } // namespace blink | 254 } // namespace blink |
OLD | NEW |