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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp

Issue 2181953004: Changed ComputedStyle's EVisibility to be an enum class and fixed naming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_move_computedstyle_around
Patch Set: Rebase Created 4 years, 4 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 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() != NONE
67 && style->visibility() != 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) {
77 if (classes.findIgnoringCase(word) != WTF::kNotFound 77 if (classes.findIgnoringCase(word) != WTF::kNotFound
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698