8000 Remove the precision="float" attribute on <input type="range"> · WebKit/WebKit@0647958 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0647958

Browse files
Ahmad-S792nt1m
authored andcommitted
Remove the precision="float" attribute on <input type="range">
Remove the precision="float" attribute on <input type="range"> https://bugs.webkit.org/show_bug.cgi?id=250047 Reviewed by Alexey Shvayka. This patch is to align WebKit with Gecko / Firefox, Blink / Chromium by removing non-standard 'precision' attribute. Merge - https://chromium.googlesource.com/chromium/blink/+/6b76e9c0e649bf8d4b1c6c321af513e0e0c6c1af This was added in WebKit but it was non-standard and it was never added by any other browser. Blink removed it in 2014 so only WebKit support it as of right now and it is broken feature since it does not support 'step' with precision="float". * Source/WebCore/html/HTMLAttributeNames.in: Remove "precision" * Source/WebCore/html/HTMLInputElement.cpp: Remove "precisionAttr" * Source/WebCore/html/RangeInputType.cpp: Remove "precision='float'" support and FIXME Canonical link: https://commits.webkit.org/258625@main
1 parent 1945032 commit 0647958

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

Source/WebCore/html/HTMLAttributeNames.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ playsinline
364364
pluginspage
365365
pluginurl
366366
poster
367-
precision
368367
preload
369368
primary
370369
progress

Source/WebCore/html/HTMLInputElement.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
33
* (C) 1999 Antti Koivisto (koivisto@kde.org)
44
* (C) 2001 Dirk Mueller (mueller@kde.org)
5-
* Copyright (C) 2004-2021 Apple Inc. All rights reserved.
5+
* Copyright (C) 2004-2023 Apple Inc. All rights reserved.
66
* (C) 2006 Alexey Proskuryakov (ap@nypop.com)
77
* Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
88
* Copyright (C) 2010-2021 Google Inc. All rights reserved.
@@ -790,7 +790,7 @@ void HTMLInputElement::parseAttribute(const QualifiedName& name, const AtomStrin
790790
m_maxResults = value.isNull() ? -1 : std::min(parseHTMLInteger(value).value_or(0), maxSavedResults);
791791
else if (name == autosaveAttr || name == incrementalAttr)
792792
invalidateStyleForSubtree();
793-
else if (name == maxAttr || name == minAttr || name == multipleAttr || name == patternAttr || name == precisionAttr || name == stepAttr)
793+
else if (name == maxAttr || name == minAttr || name == multipleAttr || name == patternAttr || name == stepAttr)
794794
updateValidity();
795795
#if ENABLE(DATALIST_ELEMENT)
796796
else if (name == listAttr) {

Source/WebCore/html/RangeInputType.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2010 Google Inc. All rights reserved.
3-
* Copyright (C) 2011-2018 Apple Inc. All rights reserved.
2+
* Copyright (C) 2010-2014 Google Inc. All rights reserved.
3+
* Copyright (C) 2011-2023 Apple Inc. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are
@@ -121,12 +121,6 @@ StepRange RangeInputType::createStepRange(AnyStepHandling anyStepHandling) const
121121
const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), rangeDefaultMinimum);
122122
const Decimal maximum = ensureMaximum(parseToNumber(element()->attributeWithoutSynchronization(maxAttr), rangeDefaultMaximum), minimum);
123123

124-
const AtomString& precisionValue = element()->attributeWithoutSynchronization(precisionAttr);
125-
if (!precisionValue.isNull()) {
126-
const Decimal step = equalLettersIgnoringASCIICase(precisionValue, "float"_s) ? Decimal::nan() : 1;
127-
return StepRange(minimum, RangeLimitations::Valid, minimum, maximum, step, rangeStepDescription);
128-
}
129-
130124
const Decimal step = StepRange::parseStep(anyStepHandling, rangeStepDescription, element()->attributeWithoutSynchronization(stepAttr));
131125
return StepRange(minimum, RangeLimitations::Valid, minimum, maximum, step, rangeStepDescription);
132126
}
@@ -335,7 +329,6 @@ bool RangeInputType::accessKeyAction(bool sendMouseEvents)
335329

336330
void RangeInputType::attributeChanged(const QualifiedName& name)
337331
{
338-
// FIXME: Don't we need to do this work for precisionAttr too?
339332
if (name == maxAttr || name == minAttr || name == valueAttr) {
340333
// Sanitize the value.
341334
if (auto* element = this->element()) {

0 commit comments

Comments
 (0)
0