Home | History | Annotate | Download | only in renderer

Lines Matching refs:element

68 bool IsOptionElement(const WebElement& element) {
70 return element.hasHTMLTagName(kOption);
73 bool IsScriptElement(const WebElement& element) {
75 return element.hasHTMLTagName(kScript);
78 bool IsNoScriptElement(const WebElement& element) {
80 return element.hasHTMLTagName(kNoScript);
87 bool IsAutofillableElement(const WebFormControlElement& element) {
88 const WebInputElement* input_element = toWebInputElement(&element);
90 IsSelectElement(element) ||
91 IsTextAreaElement(element);
150 const WebElement element = node.toConst<WebElement>();
151 if (IsOptionElement(element) ||
152 IsScriptElement(element) ||
153 IsNoScriptElement(element) ||
154 (element.isFormControlElement() &&
155 IsAutofillableElement(element.toConst<WebFormControlElement>()))) {
164 // Preserve inter-element whitespace separation.
170 // Again, preserve inter-element whitespace separation.
179 // Returns the aggregated values of the descendants of |element| that are
198 // a previous sibling of |element|,
205 base::string16 InferLabelFromPrevious(const WebFormControlElement& element) {
207 WebNode previous = element;
243 // element, consider the label to be complete.
249 // <img> and <br> tags often appear between the input element and its
272 base::string16 InferLabelFromListItem(const WebFormControlElement& element) {
273 WebNode parent = element.parentNode();
292 base::string16 InferLabelFromTableColumn(const WebFormControlElement& element) {
294 WebNode parent = element.parentNode();
303 // Check all previous siblings, skipping non-element nodes, until we find a
321 base::string16 InferLabelFromTableRow(const WebFormControlElement& element) {
323 WebNode parent = element.parentNode();
332 // Check all previous siblings, skipping non-element nodes, until we find a
350 base::string16 InferLabelFromDivTable(const WebFormControlElement& element) {
351 WebNode node = element.parentNode();
365 // If the element is in a table or fieldset, its label most likely is too.
388 const WebFormControlElement& element) {
390 WebNode parent = element.parentNode();
410 // Infers corresponding label for |element| from surrounding context in the DOM,
411 // e.g. the contents of the preceding <p> tag or text element.
412 base::string16 InferLabelForElement(const WebFormControlElement& element) {
413 base::string16 inferred_label = InferLabelFromPrevious(element);
418 inferred_label = InferLabelFromListItem(element);
423 inferred_label = InferLabelFromTableColumn(element);
428 inferred_label = InferLabelFromTableRow(element);
433 inferred_label = InferLabelFromDefinitionList(element);
438 return InferLabelFromDivTable(element);
499 WebFormControlElement* element = &control_elements[i];
501 if (base::string16(element->nameForAutofill()) != data.fields[i].name) {
511 bool is_initiating_element = (*element == initiating_element);
515 const WebInputElement* input_element = toWebInputElement(element);
518 IsTextAreaElement(*element)) &&
519 !element->value().isEmpty()))
522 if (((filters & FILTER_DISABLED_ELEMENTS) && !element->isEnabled()) ||
523 ((filters & FILTER_READONLY_ELEMENTS) && element->isReadOnly()) ||
524 ((filters & FILTER_NON_FOCUSABLE_ELEMENTS) && !element->isFocusable()))
527 callback(data.fields[i], is_initiating_element, element);
643 bool IsMonthInput(const WebInputElement* element) {
645 return element && element->formControlType() == kMonth;
649 bool IsTextInput(const WebInputElement* element) {
650 return element && element->isTextField();
653 bool IsSelectElement(const WebFormControlElement& element) {
656 return element.formControlType() == kSelectOne;
659 bool IsTextAreaElement(const WebFormControlElement& element) {
662 return element.formControlType() == kTextArea;
665 bool IsCheckableElement(const WebInputElement* element) {
666 if (!element)
669 return element->isCheckbox() || element->isRadioButton();
672 bool IsAutofillableInputElement(const WebInputElement* element) {
673 return IsTextInput(element) ||
674 IsMonthInput(element) ||
675 IsCheckableElement(element);
698 blink::WebElement element;
703 element = document.querySelector(web_descriptor, ec);
709 element = document.getElementById(web_descriptor);
715 if (element.isNull()) {
724 element.simulateClick();
739 WebFormControlElement element = control_elements[i];
740 if (!IsAutofillableElement(element))
752 autofillable_elements->push_back(element);
756 void WebFormControlElementToFormField(const WebFormControlElement& element,
760 DCHECK(!element.isNull());
766 field->name = element.nameForAutofill();
767 field->form_control_type = base::UTF16ToUTF8(element.formControlType());
769 base::UTF16ToUTF8(element.getAttribute(kAutocomplete));
777 if (!IsAutofillableElement(element))
780 const WebInputElement* input_element = toWebInputElement(&element);
782 IsTextAreaElement(element)) {
783 field->is_autofilled = element.isAutofilled();
784 field->is_focusable = element.isFocusable();
785 field->should_autocomplete = element.autoComplete();
786 field->text_direction = element.directionForFormData() ==
796 } else if (IsTextAreaElement(element)) {
800 DCHECK(IsSelectElement(element));
801 const WebSelectElement select_element = element.toConst<WebSelectElement>();
810 base::string16 value = element.value();
812 if (IsSelectElement(element)) {
813 const WebSelectElement select_element = element.toConst<WebSelectElement>();
897 // TODO(jhawkins): A label element is mapped to a form control element's id.
909 // Loop through the label elements inside the form element. For each label
910 // element, get the corresponding form control element, use the form control
911 // element's name as a key into the <name, FormFieldData> map to find the
913 // label.firstChild().nodeValue() of the label element.
925 // field element's name rather than its id, so we compensate here.
978 bool FindFormAndFieldForFormControlElement(const WebFormControlElement& element,
982 if (!IsAutofillableElement(element))
985 const WebFormElement form_element = element.form();
992 element,
999 void FillForm(const FormData& form, const WebFormControlElement& element) {
1000 WebFormElement form_element = element.form();
1005 element,
1040 void PreviewForm(const FormData& form, const WebFormControlElement& element) {
1041 WebFormElement form_element = element.form();
1046 element,
1053 bool ClearPreviewedFormWithElement(const WebFormControlElement& element,
1055 WebFormElement form_element = element.form();
1077 // If the element is not auto-filled, we did not preview it,
1094 bool is_initiating_node = (element == control_element);
1114 bool FormWithElementIsAutofilled(const WebInputElement& element) {
1115 WebFormElement form_element = element.form();
1141 bool IsWebElementEmpty(const blink::WebElement& element) {
1150 if (element.isNull())
1155 const_cast<blink::WebElement&>(element).childNodes();
1185 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) {
1186 gfx::Rect bounding_box(element->boundsInViewportSpace());