Changeset 209210 in webkit


Ignore:
Timestamp:
Dec 1, 2016 2:23:59 PM (7 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r208745. rdar://problem/29277336

Location:
branches/safari-602-branch
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/LayoutTests/ChangeLog

    r209209 r209210  
     12016-12-01  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r208745. rdar://problem/29277336
     4
     5    2016-11-14  Brent Fulgham  <bfulgham@apple.com>
     6
     7            Correct handling of changing input type
     8            https://bugs.webkit.org/show_bug.cgi?id=164759
     9            <rdar://problem/29211174>
     10
     11            Reviewed by Darin Adler.
     12
     13            * fast/forms/search-cancel-button-change-input-expected.txt: Added.
     14            * fast/forms/search-cancel-button-change-input.html: Added.
     15
    1162016-12-01  Matthew Hanson  <matthew_hanson@apple.com>
    217
  • branches/safari-602-branch/Source/WebCore/ChangeLog

    r209209 r209210  
     12016-12-01  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r208745. rdar://problem/29277336
     4
     5    2016-11-14  Brent Fulgham  <bfulgham@apple.com>
     6
     7            Correct handling of changing input type
     8            https://bugs.webkit.org/show_bug.cgi?id=164759
     9            <rdar://problem/29211174>
     10
     11            Reviewed by Darin Adler.
     12
     13            Test: fast/forms/search-cancel-button-change-input.html
     14
     15            It is possible for JavaScript to change the type property of an input field. WebKit
     16            needs to gracefully handle this case.
     17
     18            Add a type traits specialization so we can properly downcast InputType elements.
     19            Use this to only call search functions on actual search input types.
     20
     21            * html/HTMLInputElement.cpp:
     22            (WebCore::HTMLInputElement::onSearch): Only perform search functions if the
     23            input type is actually a search field.
     24            * html/InputType.h: Add type traits specialization for 'downcast' template.
     25            * html/SearchInputType.h: Ditto.
     26
    1272016-12-01  Matthew Hanson  <matthew_hanson@apple.com>
    228
  • branches/safari-602-branch/Source/WebCore/WebCore.order

    r198074 r209210  
    58355835__ZN7WebCore17MarkupAccumulator13appendOpenTagERN3WTF13StringBuilderEPNS_7ElementEPNS1_7HashMapIPNS1_16AtomicStringImplES8_NS1_7PtrHashIS8_EENS1_10HashTraitsIS8_EESC_EE
    58365836__ZNK7WebCore7Element22nodeNamePreservingCaseEv
    5837 __ZNK7WebCore13QualifiedName8toStringEv
    58385837__ZNK7WebCore7Element13hasAttributesEv
    58395838__ZN7WebCore17MarkupAccumulator22appendCustomAttributesERN3WTF13StringBuilderEPNS_7ElementEPNS1_7HashMapIPNS1_16AtomicStringImplES8_NS1_7PtrHashIS8_EENS1_10HashTraitsIS8_EESC_EE
  • branches/safari-602-branch/Source/WebCore/html/HTMLInputElement.cpp

    r203337 r209210  
    14381438void HTMLInputElement::onSearch()
    14391439{
    1440     ASSERT(isSearchField());
     1440    // The type of the input element could have changed during event handling. If we are no longer
     1441    // a search field, don't try to do search things.
     1442    if (!isSearchField())
     1443        return;
     1444
    14411445    if (m_inputType)
    1442         static_cast<SearchInputType*>(m_inputType.get())->stopSearchEventTimer();
     1446        downcast<SearchInputType>(*m_inputType.get()).stopSearchEventTimer();
    14431447    dispatchEvent(Event::create(eventNames().searchEvent, true, false));
    14441448}
  • branches/safari-602-branch/Source/WebCore/html/InputType.h

    r202197 r209210  
    328328} // namespace WebCore
    329329
    330 #endif
     330#define SPECIALIZE_TYPE_TRAITS_INPUT_TYPE(ToValueTypeName, predicate) \
     331SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
     332static bool isType(const WebCore::InputType& input) { return input.predicate; } \
     333SPECIALIZE_TYPE_TRAITS_END()
     334#endif
  • branches/safari-602-branch/Source/WebCore/html/SearchInputType.h

    r200041 r209210  
    7373} // namespace WebCore
    7474
     75SPECIALIZE_TYPE_TRAITS_INPUT_TYPE(SearchInputType, isSearchField())
    7576#endif // SearchInputType_h
Note: See TracChangeset for help on using the changeset viewer.