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

Side by Side Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 141713006: Revert egov.uscis.gov site quirk. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | no next file » | 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 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 25 matching lines...) Expand all
36 #include "bindings/v8/ExceptionStatePlaceholder.h" 36 #include "bindings/v8/ExceptionStatePlaceholder.h"
37 #include "core/dom/NodeRenderStyle.h" 37 #include "core/dom/NodeRenderStyle.h"
38 #include "core/dom/shadow/ShadowRoot.h" 38 #include "core/dom/shadow/ShadowRoot.h"
39 #include "core/editing/FrameSelection.h" 39 #include "core/editing/FrameSelection.h"
40 #include "core/editing/TextIterator.h" 40 #include "core/editing/TextIterator.h"
41 #include "core/events/BeforeTextInsertedEvent.h" 41 #include "core/events/BeforeTextInsertedEvent.h"
42 #include "core/events/KeyboardEvent.h" 42 #include "core/events/KeyboardEvent.h"
43 #include "core/events/TextEvent.h" 43 #include "core/events/TextEvent.h"
44 #include "core/frame/Frame.h" 44 #include "core/frame/Frame.h"
45 #include "core/frame/FrameHost.h" 45 #include "core/frame/FrameHost.h"
46 #include "core/frame/Settings.h"
47 #include "core/html/FormDataList.h" 46 #include "core/html/FormDataList.h"
48 #include "core/html/HTMLInputElement.h" 47 #include "core/html/HTMLInputElement.h"
49 #include "core/html/shadow/ShadowElementNames.h" 48 #include "core/html/shadow/ShadowElementNames.h"
50 #include "core/html/shadow/TextControlInnerElements.h" 49 #include "core/html/shadow/TextControlInnerElements.h"
51 #include "core/page/Chrome.h" 50 #include "core/page/Chrome.h"
52 #include "core/page/ChromeClient.h" 51 #include "core/page/ChromeClient.h"
53 #include "core/rendering/RenderDetailsMarker.h" 52 #include "core/rendering/RenderDetailsMarker.h"
54 #include "core/rendering/RenderLayer.h" 53 #include "core/rendering/RenderLayer.h"
55 #include "core/rendering/RenderTextControlSingleLine.h" 54 #include "core/rendering/RenderTextControlSingleLine.h"
56 #include "core/rendering/RenderTheme.h" 55 #include "core/rendering/RenderTheme.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 bool TextFieldInputType::shouldShowFocusRingOnMouseFocus() const 127 bool TextFieldInputType::shouldShowFocusRingOnMouseFocus() const
129 { 128 {
130 return true; 129 return true;
131 } 130 }
132 131
133 bool TextFieldInputType::isTextField() const 132 bool TextFieldInputType::isTextField() const
134 { 133 {
135 return true; 134 return true;
136 } 135 }
137 136
138 static inline bool shouldIgnoreRequiredAttribute(const HTMLInputElement& input)
139 {
140 if (!input.document().settings() || !input.document().settings()->needsSiteS pecificQuirks())
141 return false;
142 if (!equalIgnoringCase(input.document().url().host(), "egov.uscis.gov"))
143 return false;
144 return input.fastGetAttribute(requiredAttr) == "no";
145 }
146
147 bool TextFieldInputType::valueMissing(const String& value) const 137 bool TextFieldInputType::valueMissing(const String& value) const
148 { 138 {
149 return !shouldIgnoreRequiredAttribute(element()) && element().isRequired() & & value.isEmpty(); 139 return element().isRequired() && value.isEmpty();
150 } 140 }
151 141
152 bool TextFieldInputType::canSetSuggestedValue() 142 bool TextFieldInputType::canSetSuggestedValue()
153 { 143 {
154 return true; 144 return true;
155 } 145 }
156 146
157 void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange d, TextFieldEventBehavior eventBehavior) 147 void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange d, TextFieldEventBehavior eventBehavior)
158 { 148 {
159 // Grab this input element to keep reference even if JS event handler 149 // Grab this input element to keep reference even if JS event handler
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 { 565 {
576 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 566 return shouldSpinButtonRespondToMouseEvents() && element().focused();
577 } 567 }
578 568
579 void TextFieldInputType::spinButtonDidReleaseMouseCapture() 569 void TextFieldInputType::spinButtonDidReleaseMouseCapture()
580 { 570 {
581 element().dispatchFormControlChangeEvent(); 571 element().dispatchFormControlChangeEvent();
582 } 572 }
583 573
584 } // namespace WebCore 574 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698