Commit 562a3cf3 authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Invalidate labels LiveNodeList when input type changes

When the type of an HTMLInputElement changes, the labels LiveNodeList
inconsistently gets invalidated (depending whether the shadow subtree of
the input element changes).

This CL causes invalidation of the labels nodelist to happen any time
any of the name/id/type/for/form attributes changes for an element.

Bug: 795910
Change-Id: Ice58060e06150f58b4fb5c8771a413091446ff62
Reviewed-on: https://chromium-review.googlesource.com/833249Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525329}
parent af0c9396
This is a testharness.js-based test.
PASS Check if the output element is a labelable element
PASS Check if the output element can access 'labels'
PASS Check if the progress element is a labelable element
PASS Check if the progress element can access 'labels'
PASS Check if the select element is a labelable element
PASS Check if the select element can access 'labels'
PASS Check if the textarea element is a labelable form-element
PASS Check if the textarea element can access 'labels'
PASS Check if the button element is a labelable element
PASS Check if the button element can access 'labels'
PASS Check if the hidden input element is not a labelable element.
FAIL Check if the hidden input element has null 'labels' assert_equals: .labels NodeList should contain the input after the input type is changed from 'hidden' to 'checkbox' expected 1 but got 0
PASS Check if the input element in radio state is a labelable element
PASS Check if the input element in radio state can access 'labels'
PASS Check if the keygen element is not a labelable element
PASS Check if the keygen element can access 'labels'
PASS Check if the meter element is a labelable element
PASS Check if the meter element can access 'labels'
PASS Check if the fieldset element is not a labelable element
PASS Check if the fieldset element can access 'labels'
PASS Check if the label element is not a labelable element
PASS Check if the label element can access 'labels'
PASS Check if the object element is not a labelable element
PASS Check if the object element can access 'labels'
PASS Check if the img element is not a labelable element
PASS Check if the img element can access 'labels'
Harness: the test ran to completion.
...@@ -36,7 +36,7 @@ using namespace HTMLNames; ...@@ -36,7 +36,7 @@ using namespace HTMLNames;
LabelsNodeList::LabelsNodeList(ContainerNode& owner_node) LabelsNodeList::LabelsNodeList(ContainerNode& owner_node)
: LiveNodeList(owner_node, : LiveNodeList(owner_node,
kLabelsNodeListType, kLabelsNodeListType,
kInvalidateOnForAttrChange, kInvalidateForFormControls,
NodeListRootType::kTreeScope) {} NodeListRootType::kTreeScope) {}
LabelsNodeList::~LabelsNodeList() {} LabelsNodeList::~LabelsNodeList() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment