// Focus on the element.
190344
func (e *Element) Focus() error {
	e.lock.RLock()
	defer e.lock.RUnlock()

	params := &gcdapi.DOMFocusParams{
		NodeId: e.id,
	}
	_, err := e.tab.DOM.FocusWithParams(params)
	return err
}
752955
func (a *SubjectConfirmation) Element() *etree.Element {
	el := etree.NewElement("saml:SubjectConfirmation")
	el.CreateAttr("Method", a.Method)
	if a.NameID != nil {
		el.AddChild(a.NameID.Element())
	}
	if a.SubjectConfirmationData != nil {
		el.AddChild(a.SubjectConfirmationData.Element())
	}
	return el
}
96170
func (t *Tab) GetElementByLocation(x, y int) (*Element, error) {
	_, nodeId, err := t.DOM.GetNodeForLocation(x, y, false)
	if err != nil {
		return nil, err
	}
	ele, _ := t.GetElementByNodeId(nodeId)
	return ele, nil
}
591577
func (e *Event) Apply(em *Element) {
	if em.allowEvents {
		if e.Meta.EventTarget == "" {
			e.Meta.EventTarget = em.EventID()
		}
		e.tree = em
		em.events = append(em.events, e)
	}
}
455347
func (l *RgbLedDriver) On() (err error) {
	if err = l.SetLevel(l.pinRed, l.redColor); err != nil {
		return
	}

	if err = l.SetLevel(l.pinGreen, l.greenColor); err != nil {
		return
	}

	if err = l.SetLevel(l.pinBlue, l.blueColor); err != nil {
		return
	}

	l.high = true
	return
}
180241
func (d *DropDown) Focus(delegate func(p Primitive)) {
	d.Box.Focus(delegate)
	if d.open {
		delegate(d.list)
	}
}
65572
func (s *SearchSource) Highlight(highlight *Highlight) *SearchSource {
	s.highlight = highlight
	return s
}
529651
func (v ElementBuildingVisitor) mapElement(meta apply.FieldMetaImpl, item *mapItem) (*apply.MapElement, error) {
	// Function to return schema type of the map values
	var fn schemaFn = func(string) proto.Schema {
		// All map values share the same schema
		if item.Map != nil && item.Map.SubType != nil {
			return item.Map.SubType
		}
		return nil
	}

	// Collect same fields from multiple maps into a map of elements
	values, err := v.createMapValues(fn, meta, item.MapElementData)
	if err != nil {
		return nil, err
	}

	// Return the result
	return &apply.MapElement{
		FieldMetaImpl:  meta,
		MapElementData: item.MapElementData,
		Values:         values,
	}, nil
}
766715
func (a *SubjectLocality) Element() *etree.Element {
	el := etree.NewElement("saml:SubjectLocality")
	if a.Address != "" {
		el.CreateAttr("Address", a.Address)
	}
	if a.DNSName != "" {
		el.CreateAttr("DNSName", a.DNSName)
	}
	return el
}
1192125
func (e *Element) Next() *Element {
	if p := e.next; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
1215755
func (c *SimpleFocusChain) FocusNext(current Widget) Widget {
	for i, w := range c.widgets {
		if w != current {
			continue
		}
		if i < len(c.widgets)-1 {
			return c.widgets[i+1]
		}
		return c.widgets[0]
	}
	return nil
}
158793
func (p *parser) addElement() {
	p.addChild(&Node{
		Type:     ElementNode,
		DataAtom: p.tok.DataAtom,
		Data:     p.tok.Data,
		Attr:     p.tok.Attr,
	})
}
1273809
func (p *Pages) HasFocus() bool {
	for _, page := range p.pages {
		if page.Item.GetFocusable().HasFocus() {
			return true
		}
	}
	return false
}
960934
func (vector *BitVector) Element(i int) byte {
	vector.indexAssert(i)
	byteIndex := i >> 3
	byteOffset := uint32(i % 8)
	b := vector.data[byteIndex]
	// Check the offset bit
	return (b >> byteOffset) & 1
}
1355943
func Focus(t *testing.T, text string, f func(*testing.T, G, S), opts ...Option) bool {
	t.Helper()
	return Run(t, text, f, append(opts, func(c *config) { c.focus = true })...)
}
1027563
func (d *DropDown) HasFocus() bool {
	if d.open {
		return d.list.HasFocus()
	}
	return d.hasFocus
}
1276218
func (f *Form) HasFocus() bool {
	if f.hasFocus {
		return true
	}
	for _, item := range f.items {
		if item.GetFocusable().HasFocus() {
			return true
		}
	}
	for _, button := range f.buttons {
		if button.focus.HasFocus() {
			return true
		}
	}
	return false
}