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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLOListElement.cpp

Issue 2902723006: Measure the usage of <ol>.start with |reversed| and no |start| attribute. (Closed)
Patch Set: rebased Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool reversed = !params.new_value.IsNull(); 89 bool reversed = !params.new_value.IsNull();
90 if (reversed == is_reversed_) 90 if (reversed == is_reversed_)
91 return; 91 return;
92 is_reversed_ = reversed; 92 is_reversed_ = reversed;
93 UpdateItemValues(); 93 UpdateItemValues();
94 } else { 94 } else {
95 HTMLElement::ParseAttribute(params); 95 HTMLElement::ParseAttribute(params);
96 } 96 }
97 } 97 }
98 98
99 int HTMLOListElement::start() const {
100 if (has_explicit_start_)
101 return start_;
102
103 if (is_reversed_) {
104 UseCounter::Count(
105 GetDocument(),
106 UseCounter::kHTMLOListElementStartGetterReversedWithoutStartAttribute);
107 return ItemCount();
108 }
109
110 return 1;
111 }
112
99 void HTMLOListElement::setStart(int start) { 113 void HTMLOListElement::setStart(int start) {
100 SetIntegralAttribute(startAttr, start); 114 SetIntegralAttribute(startAttr, start);
101 } 115 }
102 116
103 void HTMLOListElement::UpdateItemValues() { 117 void HTMLOListElement::UpdateItemValues() {
104 if (!GetLayoutObject()) 118 if (!GetLayoutObject())
105 return; 119 return;
106 UpdateDistribution(); 120 UpdateDistribution();
107 LayoutListItem::UpdateItemValuesForOrderedList(this); 121 LayoutListItem::UpdateItemValuesForOrderedList(this);
108 } 122 }
109 123
110 void HTMLOListElement::RecalculateItemCount() { 124 void HTMLOListElement::RecalculateItemCount() {
111 item_count_ = LayoutListItem::ItemCountForOrderedList(this); 125 item_count_ = LayoutListItem::ItemCountForOrderedList(this);
112 should_recalculate_item_count_ = false; 126 should_recalculate_item_count_ = false;
113 } 127 }
114 128
115 } // namespace blink 129 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLOListElement.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698