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

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

Issue 2370673002: Changed EDisplay to an enum class and renamed its members to be keywords (Closed)
Patch Set: Comment 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 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
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
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
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698