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

Side by Side Diff: Source/core/rendering/RenderTheme.cpp

Issue 137433008: Have HTMLCollection::item() return an Element as per specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « Source/core/html/forms/RangeInputType.cpp ('k') | Source/web/WebDocument.cpp » ('j') | 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 * This file is part of the theme implementation for form controls in WebCore. 2 * This file is part of the theme implementation for form controls in WebCore.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 } else { 925 } else {
926 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); 926 tickRect.setWidth(floor(tickSize.height() * zoomFactor));
927 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); 927 tickRect.setHeight(floor(tickSize.width() * zoomFactor));
928 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom TrackCenter() * zoomFactor)); 928 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom TrackCenter() * zoomFactor));
929 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w idth() * zoomFactor) / 2.0; 929 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w idth() * zoomFactor) / 2.0;
930 tickRegionWidth = trackBounds.height() - thumbSize.width(); 930 tickRegionWidth = trackBounds.height() - thumbSize.width();
931 } 931 }
932 RefPtr<HTMLCollection> options = dataList->options(); 932 RefPtr<HTMLCollection> options = dataList->options();
933 GraphicsContextStateSaver stateSaver(*paintInfo.context); 933 GraphicsContextStateSaver stateSaver(*paintInfo.context);
934 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor)); 934 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor));
935 for (unsigned i = 0; Node* node = options->item(i); i++) { 935 for (unsigned i = 0; Element* element = options->item(i); i++) {
936 ASSERT(node->hasTagName(optionTag)); 936 ASSERT(element->hasTagName(optionTag));
937 HTMLOptionElement* optionElement = toHTMLOptionElement(node); 937 HTMLOptionElement* optionElement = toHTMLOptionElement(element);
938 String value = optionElement->value(); 938 String value = optionElement->value();
939 if (!input->isValidValue(value)) 939 if (!input->isValidValue(value))
940 continue; 940 continue;
941 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val ue)); 941 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val ue));
942 double tickFraction = (parsedValue - min) / (max - min); 942 double tickFraction = (parsedValue - min) / (max - min);
943 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction; 943 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
944 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic kRatio); 944 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic kRatio);
945 if (isHorizontal) 945 if (isHorizontal)
946 tickRect.setX(tickPosition); 946 tickRect.setX(tickPosition);
947 else 947 else
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 1272
1273 // padding - not honored by WinIE, needs to be removed. 1273 // padding - not honored by WinIE, needs to be removed.
1274 style->resetPadding(); 1274 style->resetPadding();
1275 1275
1276 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 1276 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
1277 // for now, we will not honor it. 1277 // for now, we will not honor it.
1278 style->resetBorder(); 1278 style->resetBorder();
1279 } 1279 }
1280 1280
1281 } // namespace WebCore 1281 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/RangeInputType.cpp ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698