|
|
Created:
4 years, 5 months ago by ramya.v Modified:
4 years, 5 months ago CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionOpen a color input with display:none via a label
BUG=452838
Committed: https://crrev.com/9447bd245501e7f1abb9b51f1420e8ef4f73c4dc
Cr-Commit-Position: refs/heads/master@{#403638}
Patch Set 1 #Patch Set 2 : Added testcase #Patch Set 3 : Updated testcase to include closure of popup when parent is removed #
Total comments: 10
Patch Set 4 : Updated test case as per review comments #
Messages
Total messages: 18 (5 generated)
ramya.v@samsung.com changed reviewers: + tkent@chromium.org
PTAL! Thanks
tkent@chromium.org changed reviewers: + keishi@chromium.org
I wonder whether the color picker is closed correctly on the document shutdown if it is opened during display:none. We call InputTypeView::closePopupView() from HTMLInputElement::detach. It's enough because we open the color picker only if the color input has a LayoutObject.
On 2016/07/01 00:30:20, tkent wrote: > I wonder whether the color picker is closed correctly on the document shutdown > if it is opened during display:none. > > We call InputTypeView::closePopupView() from HTMLInputElement::detach. It's > enough because we open the color picker only if the color input has a > LayoutObject. Ex: https://jsfiddle.net/pe0v07vn/ (click on label on load of the page) After 5sec, Firefox: only input is removed. Chrome: With this patch, input as well as picker dialog are removed. Updated the existing test-case with this scenario.
> Chrome: With this patch, input as well as picker dialog are removed. Can you tell me what code path closed the picker? https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); In this case, HTMLInputElement::removedFrom() is called. So the picker is closed by InputTypeView::closePopupView(). I talked about a case of a document destruction, which won't call HTMLInputElement::removedFrom(). https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:26: setTimeout(function() { assert_false(testRunner.isChooserShown()); }, 5000); This doesn't work. This is a sync test.
https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); On 2016/07/01 06:54:08, tkent wrote: > In this case, HTMLInputElement::removedFrom() is called. So the picker is > closed by InputTypeView::closePopupView(). > > I talked about a case of a document destruction, which won't call > HTMLInputElement::removedFrom(). Can you please provide a test case of document destruction? Will check if closePopup can be called from document destruction code path as well. Also one more doubt, is there any specific reason that file input and color input handled differently in case of display none case? https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:26: setTimeout(function() { assert_false(testRunner.isChooserShown()); }, 5000); On 2016/07/01 06:54:08, tkent wrote: > This doesn't work. This is a sync test. Did not get you? Test case shows pass. Is this line invalid?
https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); On 2016/07/01 at 09:14:45, ramya.v wrote: > On 2016/07/01 06:54:08, tkent wrote: > > In this case, HTMLInputElement::removedFrom() is called. So the picker is > > closed by InputTypeView::closePopupView(). > > > > I talked about a case of a document destruction, which won't call > > HTMLInputElement::removedFrom(). > > > Can you please provide a test case of document destruction? Will check if closePopup can be called from document destruction code path as well. > Also one more doubt, is there any specific reason that file input and color input handled differently in case of display none case? for example, 1. click a label associated to input[type=color] with display:none 2. click a link in the same document to navigate to another page. Picker implementations of input[type=color] and input[type=file] are very different. So I have a concern. https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:26: setTimeout(function() { assert_false(testRunner.isChooserShown()); }, 5000); On 2016/07/01 at 09:14:45, ramya.v wrote: > On 2016/07/01 06:54:08, tkent wrote: > > This doesn't work. This is a sync test. > > Did not get you? Test case shows pass. Is this line invalid? I didn't try this patch. But this assert_false() won't be executed in run-webkit-tests command or |content_shel --run-layout-test|.
https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); On 2016/07/01 09:23:28, tkent wrote: > On 2016/07/01 at 09:14:45, ramya.v wrote: > > On 2016/07/01 06:54:08, tkent wrote: > > > In this case, HTMLInputElement::removedFrom() is called. So the picker is > > > closed by InputTypeView::closePopupView(). > > > > > > I talked about a case of a document destruction, which won't call > > > HTMLInputElement::removedFrom(). > > > > > > Can you please provide a test case of document destruction? Will check if > closePopup can be called from document destruction code path as well. > > Also one more doubt, is there any specific reason that file input and color > input handled differently in case of display none case? > > for example, > 1. click a label associated to input[type=color] with display:none > 2. click a link in the same document to navigate to another page. > > Picker implementations of input[type=color] and input[type=file] are very > different. So I have a concern. Made below test case. <!DOCTYPE html> <input type="color" id="colorPick" /> <label for="colorPick">Pick a color</label> <a id="link" href="http://www.google.com">Google</a> <style> input { display: none; } </style> <script> setTimeout(function() { document.getElementById("link").click(); }, 5000); </script> In this case, irrespective of color picker opened with input display none or not, Firefox: picker not dismissed. Chrome: Windows : picker is not dismissed. Linux: picker is dismissed. I've linux opensource setup. There call-stack is as below in this case. ColorInputType::closePopupView ContainerNode::detach() Element::detach() ContainerNode::detach() Element::detach() ContainerNode::detach() Document::detach() FrameLoader::prepareForCommit() https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:26: setTimeout(function() { assert_false(testRunner.isChooserShown()); }, 5000); On 2016/07/01 09:23:28, tkent wrote: > On 2016/07/01 at 09:14:45, ramya.v wrote: > > On 2016/07/01 06:54:08, tkent wrote: > > > This doesn't work. This is a sync test. > > > > Did not get you? Test case shows pass. Is this line invalid? > > I didn't try this patch. But this assert_false() won't be executed in > run-webkit-tests command or |content_shel --run-layout-test|. Thanks got your point :) Will remove testing this way.
https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); On 2016/07/01 at 10:05:50, ramya.v wrote: > In this case, irrespective of color picker opened with input display none or not, > Firefox: picker not dismissed. > Chrome: > Windows : picker is not dismissed. > Linux: picker is dismissed. Thank you for the investigation. So, this CL won't make the situation worse. LGTM. BTW, would you file a bug about this scenario please?
https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html (right): https://codereview.chromium.org/2110783002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html:25: document.body.removeChild(div); On 2016/07/04 01:25:59, tkent wrote: > On 2016/07/01 at 10:05:50, ramya.v wrote: > > In this case, irrespective of color picker opened with input display none or > not, > > Firefox: picker not dismissed. > > Chrome: > > Windows : picker is not dismissed. > > Linux: picker is dismissed. > > Thank you for the investigation. So, this CL won't make the situation worse. > LGTM. > BTW, would you file a bug about this scenario please? Filed a bug in crbug.com/625525. Done.
The CQ bit was checked by ramya.v@samsung.com
The patchset sent to the CQ was uploaded after l-g-t-m from tkent@chromium.org Link to the patchset: https://codereview.chromium.org/2110783002/#ps60001 (title: "Updated test case as per review comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
CQ bit was unchecked.
Message was sent while issue was closed.
Description was changed from ========== Open a color input with display:none via a label BUG=452838 ========== to ========== Open a color input with display:none via a label BUG=452838 Committed: https://crrev.com/9447bd245501e7f1abb9b51f1420e8ef4f73c4dc Cr-Commit-Position: refs/heads/master@{#403638} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/9447bd245501e7f1abb9b51f1420e8ef4f73c4dc Cr-Commit-Position: refs/heads/master@{#403638} |