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

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

Issue 2486793002: Make getIntegralAttribute use parseHTMLInteger (Closed)
Patch Set: Fix test results Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-grouping-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 3308 matching lines...) Expand 10 before | Expand all | Expand 10 after
3319 DCHECK(isURLAttribute(*attribute)); 3319 DCHECK(isURLAttribute(*attribute));
3320 } 3320 }
3321 #endif 3321 #endif
3322 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name)); 3322 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));
3323 if (value.isEmpty()) 3323 if (value.isEmpty())
3324 return KURL(); 3324 return KURL();
3325 return document().completeURL(value); 3325 return document().completeURL(value);
3326 } 3326 }
3327 3327
3328 int Element::getIntegralAttribute(const QualifiedName& attributeName) const { 3328 int Element::getIntegralAttribute(const QualifiedName& attributeName) const {
3329 return getAttribute(attributeName).toInt(); 3329 int integralValue = 0;
3330 parseHTMLInteger(getAttribute(attributeName), integralValue);
3331 return integralValue;
3330 } 3332 }
3331 3333
3332 void Element::setIntegralAttribute(const QualifiedName& attributeName, 3334 void Element::setIntegralAttribute(const QualifiedName& attributeName,
3333 int value) { 3335 int value) {
3334 setAttribute(attributeName, AtomicString::number(value)); 3336 setAttribute(attributeName, AtomicString::number(value));
3335 } 3337 }
3336 3338
3337 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, 3339 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName,
3338 unsigned value) { 3340 unsigned value) {
3339 // Range restrictions are enforced for unsigned IDL attributes that 3341 // Range restrictions are enforced for unsigned IDL attributes that
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
4088 } 4090 }
4089 4091
4090 DEFINE_TRACE_WRAPPERS(Element) { 4092 DEFINE_TRACE_WRAPPERS(Element) {
4091 if (hasRareData()) { 4093 if (hasRareData()) {
4092 visitor->traceWrappers(elementRareData()); 4094 visitor->traceWrappers(elementRareData());
4093 } 4095 }
4094 ContainerNode::traceWrappers(visitor); 4096 ContainerNode::traceWrappers(visitor);
4095 } 4097 }
4096 4098
4097 } // namespace blink 4099 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-grouping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698