WebKit Bugzilla
Attachment 341301 Details for
Bug 185982
: iOS: setting 'defaultValue' of input type=date from script does not cause UI update
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185982-20180525134921.patch (text/plain), 5.86 KB, created by
Stephen McGruer
on 2018-05-25 10:49:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Stephen McGruer
Created:
2018-05-25 10:49:21 PDT
Size:
5.86 KB
patch
obsolete
>Subversion Revision: 232122 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index df196cb7f0b16eaaeedd9288adc25b868cdcb205..d447986a4d7e9d725bdffd94ff00a6bd2be8fd9c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-05-25 Stephen McGruer <smcgruer@chromium.org> >+ >+ iOS: setting 'defaultValue' of input type=date from script should cause a UI update >+ https://bugs.webkit.org/show_bug.cgi?id=185982 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/forms/date/date-appearance-defaultValue.html >+ >+ * html/BaseChooserOnlyDateAndTimeInputType.cpp: >+ (WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged): >+ * html/BaseChooserOnlyDateAndTimeInputType.h: >+ * html/HTMLInputElement.cpp: >+ (WebCore::HTMLInputElement::parseAttribute): >+ * html/InputType.cpp: >+ (WebCore::InputType::valueAttributeChanged): >+ * html/InputType.h: >+ > 2018-05-23 Youenn Fablet <youenn@apple.com> > > NetworkLoadChecker should check cached redirections >diff --git a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >index d434eb431e3b12f8e65afb142ed5105c516ef690..72d6b146d74ac3f4e4453fa24570b86a1e762ccc 100644 >--- a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >+++ b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp >@@ -134,5 +134,11 @@ bool BaseChooserOnlyDateAndTimeInputType::isMouseFocusable() const > return element().isTextFormControlFocusable(); > } > >+void BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged() >+{ >+ if (!element().hasDirtyValue()) >+ updateAppearance(); >+} >+ > } > #endif >diff --git a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h >index 6d54ebf2fc8354f497934e244c80af4fbc36b3c2..3cbfddfc7c95c1d7bcc98a935b46310b2a406dda 100644 >--- a/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h >+++ b/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h >@@ -53,6 +53,7 @@ private: > void handleKeyupEvent(KeyboardEvent&) override; > void accessKeyAction(bool sendMouseEvents) override; > bool isMouseFocusable() const override; >+ void valueAttributeChanged() override; > > // DateTimeChooserClient functions: > void didChooseValue(const String&) override; >diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp >index 848eda5f00653098a58d9f34c6293243f77c6841..88c6c2a9fe88f20d0eb1e1cc3ed5c7b53191a13f 100644 >--- a/Source/WebCore/html/HTMLInputElement.cpp >+++ b/Source/WebCore/html/HTMLInputElement.cpp >@@ -728,6 +728,7 @@ void HTMLInputElement::parseAttribute(const QualifiedName& name, const AtomicStr > setFormControlValueMatchesRenderer(false); > updateValidity(); > m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress; >+ m_inputType->valueAttributeChanged(); > } else if (name == checkedAttr) { > if (m_inputType->isCheckable()) > invalidateStyleForSubtree(); >diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp >index 8bec3a6f400974aadc4beab349be06f8d4cb7a57..ca6f5bab7acad1848a153b5bdfb88e9db4d41827 100644 >--- a/Source/WebCore/html/InputType.cpp >+++ b/Source/WebCore/html/InputType.cpp >@@ -936,6 +936,10 @@ bool InputType::hasTouchEventHandler() const > } > #endif > >+void InputType::valueAttributeChanged() >+{ >+} >+ > String InputType::defaultToolTip() const > { > return String(); >diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h >index d0b86b58a035bbc01546ba3c4712fa40661413b0..0b0b00a2040d02a95458868cf5d2b6f9390617c9 100644 >--- a/Source/WebCore/html/InputType.h >+++ b/Source/WebCore/html/InputType.h >@@ -265,6 +265,7 @@ public: > virtual void capsLockStateMayHaveChanged(); > virtual void updateAutoFillButton(); > virtual String defaultToolTip() const; >+ virtual void valueAttributeChanged(); > virtual bool matchesIndeterminatePseudoClass() const; > virtual bool shouldAppearIndeterminate() const; > virtual bool supportsSelectionAPI() const; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 65091290b64c1e43572d26210c639e90b7d79121..a2955ea654c4ed27c863f1a22b3cd25b0591f2b9 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-25 Stephen McGruer <smcgruer@chromium.org> >+ >+ iOS: setting 'defaultValue' of input type=date from script should cause a UI update >+ https://bugs.webkit.org/show_bug.cgi?id=185982 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/forms/date/date-appearance-defaultValue-expected.html: Added. >+ * fast/forms/date/date-appearance-defaultValue.html: Added. >+ > 2018-05-23 Youenn Fablet <youenn@apple.com> > > NetworkLoadChecker should check cached redirections >diff --git a/LayoutTests/fast/forms/date/date-appearance-defaultValue-expected.html b/LayoutTests/fast/forms/date/date-appearance-defaultValue-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ae736d0906cd33509fae5a00d6b04d075c0b7bc1 >--- /dev/null >+++ b/LayoutTests/fast/forms/date/date-appearance-defaultValue-expected.html >@@ -0,0 +1,5 @@ >+<html> >+<body> >+<input type="date" value="2005-06-07"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/date/date-appearance-defaultValue.html b/LayoutTests/fast/forms/date/date-appearance-defaultValue.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cb180a7bd16c5fb165a63a3d05253ff09e66d70f >--- /dev/null >+++ b/LayoutTests/fast/forms/date/date-appearance-defaultValue.html >@@ -0,0 +1,9 @@ >+<!-- This tests that setting defaultValue via script is reflected in the UI. See https://bugs.webkit.org/show_bug.cgi?id=185982 --> >+<html> >+<body> >+<input type="date"> >+<script> >+document.querySelector('input').defaultValue = '2005-06-07' >+</script> >+</body> >+</html>
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185982
: 341301