WebKit Bugzilla
Attachment 341960 Details for
Bug 186304
: Fix the iOS build after r232496
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186304-20180605115806.patch (text/plain), 18.86 KB, created by
Antoine Quint
on 2018-06-05 02:58:08 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2018-06-05 02:58:08 PDT
Size:
18.86 KB
patch
obsolete
>Subversion Revision: 232504 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8bd67f23582eafde95c57214f88fca7aac7c3cd9..9cd1bd7a67db674cf5a78e4464922b9a019f5cf8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2018-06-05 Antoine Quint <graouts@apple.com> >+ >+ Fix the iOS build after r232496 >+ https://bugs.webkit.org/show_bug.cgi?id=186304 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The changes in r232496 changed the InputType::element() signature from HTMLInputElement& >+ to HTMLInputElement* and some call sites did not expect that. >+ >+ * html/BaseChooserOnlyDateAndTimeInputType.cpp: >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction): >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const): >+ * html/BaseDateAndTimeInputType.cpp: >+ (WebCore::BaseDateAndTimeInputType::setValueAsDate const): >+ (WebCore::BaseDateAndTimeInputType::valueAsDouble const): >+ (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const): >+ (WebCore::BaseDateAndTimeInputType::typeMismatch const): >+ (WebCore::BaseDateAndTimeInputType::serializeWithComponents const): >+ (WebCore::BaseDateAndTimeInputType::localizeValue const): >+ (WebCore::BaseDateAndTimeInputType::visibleValue const): >+ (WebCore::BaseDateAndTimeInputType::valueMissing const): >+ (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const): >+ * html/DateInputType.cpp: >+ (WebCore::DateInputType::createStepRange const): >+ * html/DateTimeLocalInputType.cpp: >+ (WebCore::DateTimeLocalInputType::createStepRange const): >+ * html/MonthInputType.cpp: >+ (WebCore::MonthInputType::valueAsDate const): >+ (WebCore::MonthInputType::createStepRange const): >+ * html/TimeInputType.cpp: >+ (WebCore::TimeInputType::createStepRange const): >+ * html/WeekInputType.cpp: >+ (WebCore::WeekInputType::createStepRange const): >+ > 2018-06-03 Darin Adler <darin@apple.com> > > [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption >diff --git a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >index 5c463a07403f153e9147fa87b2a6174f7127b801..5c12f6c1544d3a5bc372476c29753ea62b279b4b 100644 >--- a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >+++ b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >@@ -46,15 +46,16 @@ BaseChooserOnlyDateAndTimeInputType::~BaseChooserOnlyDateAndTimeInputType() > > void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event&) > { >- if (element().isDisabledOrReadOnly() || !element().renderer() || !UserGestureIndicator::processingUserGesture()) >+ ASSERT(element()); >+ if (element()->isDisabledOrReadOnly() || !element()->renderer() || !UserGestureIndicator::processingUserGesture()) > return; > > if (m_dateTimeChooser) > return; >- if (!element().document().page()) >+ if (!element()->document().page()) > return; > DateTimeChooserParameters parameters; >- if (!element().setupDateTimeChooserParameters(parameters)) >+ if (!element()->setupDateTimeChooserParameters(parameters)) > return; > } > >@@ -62,15 +63,17 @@ void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree() > { > static NeverDestroyed<AtomicString> valueContainerPseudo("-webkit-date-and-time-value", AtomicString::ConstructFromLiteral); > >- auto valueContainer = HTMLDivElement::create(element().document()); >+ ASSERT(element()); >+ auto valueContainer = HTMLDivElement::create(element()->document()); > valueContainer->setPseudo(valueContainerPseudo); >- element().userAgentShadowRoot()->appendChild(valueContainer); >+ element()->userAgentShadowRoot()->appendChild(valueContainer); > updateInnerTextValue(); > } > > void BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue() > { >- RefPtr<Node> node = element().userAgentShadowRoot()->firstChild(); >+ ASSERT(element()); >+ RefPtr<Node> node = element()->userAgentShadowRoot()->firstChild(); > if (!is<HTMLElement>(node)) > return; > String displayValue = visibleValue(); >@@ -95,7 +98,8 @@ void BaseChooserOnlyDateAndTimeInputType::detach() > > void BaseChooserOnlyDateAndTimeInputType::didChooseValue(const String& value) > { >- element().setValue(value, DispatchInputAndChangeEvent); >+ ASSERT(element()); >+ element()->setValue(value, DispatchInputAndChangeEvent); > } > > void BaseChooserOnlyDateAndTimeInputType::didEndChooser() >@@ -111,12 +115,14 @@ void BaseChooserOnlyDateAndTimeInputType::closeDateTimeChooser() > > void BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent(KeyboardEvent& event) > { >- BaseClickableWithKeyInputType::handleKeydownEvent(element(), event); >+ ASSERT(element()); >+ BaseClickableWithKeyInputType::handleKeydownEvent(*element(), event); > } > > void BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent(KeyboardEvent& event) > { >- BaseClickableWithKeyInputType::handleKeypressEvent(element(), event); >+ ASSERT(element()); >+ BaseClickableWithKeyInputType::handleKeypressEvent(*element(), event); > } > > void BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent(KeyboardEvent& event) >@@ -127,12 +133,14 @@ void BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent(KeyboardEvent& event) > void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents) > { > BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents); >- BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents); >+ ASSERT(element()); >+ BaseClickableWithKeyInputType::accessKeyAction(*element(), sendMouseEvents); > } > > bool BaseChooserOnlyDateAndTimeInputType::isMouseFocusable() const > { >- return element().isTextFormControlFocusable(); >+ ASSERT(element()); >+ return element()->isTextFormControlFocusable(); > } > > void BaseChooserOnlyDateAndTimeInputType::attributeChanged(const QualifiedName& name) >diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.cpp b/Source/WebCore/html/BaseDateAndTimeInputType.cpp >index cc9070a1a072a0b07bf231b0058a86e8d1370ac1..9036e764676490118b89a84d9e862559b89a08cc 100644 >--- a/Source/WebCore/html/BaseDateAndTimeInputType.cpp >+++ b/Source/WebCore/html/BaseDateAndTimeInputType.cpp >@@ -57,19 +57,22 @@ double BaseDateAndTimeInputType::valueAsDate() const > > ExceptionOr<void> BaseDateAndTimeInputType::setValueAsDate(double value) const > { >- element().setValue(serializeWithMilliseconds(value)); >+ ASSERT(element()); >+ element()->setValue(serializeWithMilliseconds(value)); > return { }; > } > > double BaseDateAndTimeInputType::valueAsDouble() const > { >- const Decimal value = parseToNumber(element().value(), Decimal::nan()); >+ ASSERT(element()); >+ const Decimal value = parseToNumber(element()->value(), Decimal::nan()); > return value.isFinite() ? value.toDouble() : DateComponents::invalidMilliseconds(); > } > > ExceptionOr<void> BaseDateAndTimeInputType::setValueAsDecimal(const Decimal& newValue, TextFieldEventBehavior eventBehavior) const > { >- element().setValue(serialize(newValue), eventBehavior); >+ ASSERT(element()); >+ element()->setValue(serialize(newValue), eventBehavior); > return { }; > } > >@@ -80,7 +83,8 @@ bool BaseDateAndTimeInputType::typeMismatchFor(const String& value) const > > bool BaseDateAndTimeInputType::typeMismatch() const > { >- return typeMismatchFor(element().value()); >+ ASSERT(element()); >+ return typeMismatchFor(element()->value()); > } > > Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const >@@ -136,8 +140,9 @@ String BaseDateAndTimeInputType::serialize(const Decimal& value) const > > String BaseDateAndTimeInputType::serializeWithComponents(const DateComponents& date) const > { >+ ASSERT(element()); > Decimal step; >- if (!element().getAllowedValueStep(&step)) >+ if (!element()->getAllowedValueStep(&step)) > return date.toString(); > if (step.remainder(msecPerMinute).isZero()) > return date.toString(DateComponents::None); >@@ -157,13 +162,15 @@ String BaseDateAndTimeInputType::localizeValue(const String& proposedValue) cons > if (!parseToDateComponents(proposedValue, &date)) > return proposedValue; > >- String localized = element().locale().formatDateTime(date); >+ ASSERT(element()); >+ String localized = element()->locale().formatDateTime(date); > return localized.isEmpty() ? proposedValue : localized; > } > > String BaseDateAndTimeInputType::visibleValue() const > { >- return localizeValue(element().value()); >+ ASSERT(element()); >+ return localizeValue(element()->value()); > } > > String BaseDateAndTimeInputType::sanitizeValue(const String& proposedValue) const >@@ -183,13 +190,15 @@ bool BaseDateAndTimeInputType::shouldRespectListAttribute() > > bool BaseDateAndTimeInputType::valueMissing(const String& value) const > { >- return element().isRequired() && value.isEmpty(); >+ ASSERT(element()); >+ return element()->isRequired() && value.isEmpty(); > } > > #if PLATFORM(IOS) > bool BaseDateAndTimeInputType::isKeyboardFocusable(KeyboardEvent*) const > { >- return !element().isReadOnly() && element().isTextFormControlFocusable(); >+ ASSERT(element()); >+ return !element()->isReadOnly() && element()->isTextFormControlFocusable(); > } > #endif > >diff --git a/Source/WebCore/html/DateInputType.cpp b/Source/WebCore/html/DateInputType.cpp >index 1eb61b3f798c46c97b6469b48d7b97d986c7fe9c..5188ad34710ddfb4640ce19e0c20d175553ca1a1 100644 >--- a/Source/WebCore/html/DateInputType.cpp >+++ b/Source/WebCore/html/DateInputType.cpp >@@ -64,10 +64,11 @@ StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const > { > static NeverDestroyed<const StepRange::StepDescription> stepDescription(dateDefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger); > >- const Decimal stepBase = parseToNumber(element().attributeWithoutSynchronization(minAttr), 0); >- const Decimal minimum = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumDate())); >- const Decimal maximum = parseToNumber(element().attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumDate())); >- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().attributeWithoutSynchronization(stepAttr)); >+ ASSERT(element()); >+ const Decimal stepBase = parseToNumber(element()->attributeWithoutSynchronization(minAttr), 0); >+ const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumDate())); >+ const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumDate())); >+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->attributeWithoutSynchronization(stepAttr)); > return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, stepDescription); > } > >diff --git a/Source/WebCore/html/DateTimeLocalInputType.cpp b/Source/WebCore/html/DateTimeLocalInputType.cpp >index bdc385783909e61fda45a77df89d1ac2c029ab94..74f5866b170740efd362511eb2dc3e19aa1abc49 100644 >--- a/Source/WebCore/html/DateTimeLocalInputType.cpp >+++ b/Source/WebCore/html/DateTimeLocalInputType.cpp >@@ -72,10 +72,11 @@ StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin > { > static NeverDestroyed<const StepRange::StepDescription> stepDescription(dateTimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor, StepRange::ScaledStepValueShouldBeInteger); > >- const Decimal stepBase = parseToNumber(element().attributeWithoutSynchronization(minAttr), 0); >- const Decimal minimum = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumDateTime())); >- const Decimal maximum = parseToNumber(element().attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumDateTime())); >- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().attributeWithoutSynchronization(stepAttr)); >+ ASSERT(element()); >+ const Decimal stepBase = parseToNumber(element()->attributeWithoutSynchronization(minAttr), 0); >+ const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumDateTime())); >+ const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumDateTime())); >+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->attributeWithoutSynchronization(stepAttr)); > return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, stepDescription); > } > >diff --git a/Source/WebCore/html/MonthInputType.cpp b/Source/WebCore/html/MonthInputType.cpp >index 22eeada335e8049510b641461e9b374d9763b852..5977caa0ab001f758807f53497a7b53ef526e74f 100644 >--- a/Source/WebCore/html/MonthInputType.cpp >+++ b/Source/WebCore/html/MonthInputType.cpp >@@ -59,8 +59,9 @@ DateComponents::Type MonthInputType::dateType() const > > double MonthInputType::valueAsDate() const > { >+ ASSERT(element()); > DateComponents date; >- if (!parseToDateComponents(element().value(), &date)) >+ if (!parseToDateComponents(element()->value(), &date)) > return DateComponents::invalidMilliseconds(); > double msec = date.millisecondsSinceEpoch(); > ASSERT(std::isfinite(msec)); >@@ -92,10 +93,11 @@ StepRange MonthInputType::createStepRange(AnyStepHandling anyStepHandling) const > { > static NeverDestroyed<const StepRange::StepDescription> stepDescription(monthDefaultStep, monthDefaultStepBase, monthStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger); > >- const Decimal stepBase = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(monthDefaultStepBase)); >- const Decimal minimum = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumMonth())); >- const Decimal maximum = parseToNumber(element().attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumMonth())); >- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().attributeWithoutSynchronization(stepAttr)); >+ ASSERT(element()); >+ const Decimal stepBase = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(monthDefaultStepBase)); >+ const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumMonth())); >+ const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumMonth())); >+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->attributeWithoutSynchronization(stepAttr)); > return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, stepDescription); > } > >diff --git a/Source/WebCore/html/TimeInputType.cpp b/Source/WebCore/html/TimeInputType.cpp >index 4fa481d4f8eea55c5fcca5db40433cae07796e9a..079939cc635ce74b31918edf0acffbd92a5a7a43 100644 >--- a/Source/WebCore/html/TimeInputType.cpp >+++ b/Source/WebCore/html/TimeInputType.cpp >@@ -79,10 +79,11 @@ StepRange TimeInputType::createStepRange(AnyStepHandling anyStepHandling) const > { > static NeverDestroyed<const StepRange::StepDescription> stepDescription(timeDefaultStep, timeDefaultStepBase, timeStepScaleFactor, StepRange::ScaledStepValueShouldBeInteger); > >- const Decimal stepBase = parseToNumber(element().attributeWithoutSynchronization(minAttr), 0); >- const Decimal minimum = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumTime())); >- const Decimal maximum = parseToNumber(element().attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumTime())); >- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().attributeWithoutSynchronization(stepAttr)); >+ ASSERT(element()); >+ const Decimal stepBase = parseToNumber(element()->attributeWithoutSynchronization(minAttr), 0); >+ const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumTime())); >+ const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumTime())); >+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->attributeWithoutSynchronization(stepAttr)); > return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, stepDescription); > } > >diff --git a/Source/WebCore/html/WeekInputType.cpp b/Source/WebCore/html/WeekInputType.cpp >index 7318b59363af3215df0a3b4d263e538c5fe447f1..d63790dead2b64066ffd36692869e2f8553ecdf3 100644 >--- a/Source/WebCore/html/WeekInputType.cpp >+++ b/Source/WebCore/html/WeekInputType.cpp >@@ -59,10 +59,11 @@ StepRange WeekInputType::createStepRange(AnyStepHandling anyStepHandling) const > { > static NeverDestroyed<const StepRange::StepDescription> stepDescription(weekDefaultStep, weekDefaultStepBase, weekStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger); > >- const Decimal stepBase = parseToNumber(element().attributeWithoutSynchronization(minAttr), weekDefaultStepBase); >- const Decimal minimum = parseToNumber(element().attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumWeek())); >- const Decimal maximum = parseToNumber(element().attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumWeek())); >- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().attributeWithoutSynchronization(stepAttr)); >+ ASSERT(element()); >+ const Decimal stepBase = parseToNumber(element()->attributeWithoutSynchronization(minAttr), weekDefaultStepBase); >+ const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), Decimal::fromDouble(DateComponents::minimumWeek())); >+ const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumWeek())); >+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->attributeWithoutSynchronization(stepAttr)); > return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, stepDescription); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bfulgham
:
review+
bfulgham
:
commit-queue+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186304
: 341960