Gets the parent element which blocks the styling for an element. This can be done through read-only elements (contenteditable=false) or elements with the "data-nostyle" attribute.
172130
function getUnstylableParent( element )
	{
		var unstylable,
			editable;

		while ( ( element = element.getParent() ) )
		{
			if ( element.getName() == 'body' )
				break;

			if ( element.getAttribute( 'data-nostyle' ) )
				unstylable = element;
			else if ( !editable )
			{
				var contentEditable = element.getAttribute( 'contentEditable' );

				if ( contentEditable == 'false' )
					unstylable = element;
				else if ( contentEditable == 'true' )
					editable = 1;
			}
		}

		return unstylable;
	}
1339521
def get_element_id(element):
        
        id_attrib_key = add_ns('id')
        if id_attrib_key in element.attrib:
            return element.attrib[id_attrib_key]
        try:
            return element.getparent().attrib[id_attrib_key]
        except KeyError as e:
            raise KeyError(
                'Neither the element "{0}" nor its parent "{1}" '
                'have an ID'.format(element, element.getparent()))
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
154630
def parent_element(self):
        
        def parent_element():
            """
            Wrapper to get parent element
            """
            parent = self.driver_wrapper.execute_script('return arguments[0].parentNode;', self.element)
            wrapped_parent = WebElementWrapper(self.driver_wrapper, '', parent)
            return wrapped_parent

        return self.execute_and_handle_webelement_exceptions(parent_element, 'get parent element')
23236
function getParentSelector() {
  const type = NodeType.ParentSelectorType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = '&';

  pos++;

  return newNode(type, content, line, column);
}
194125
function getScrollElementFromTarget(elem, stopParent) {
        stopParent = stopParent || document;
        if (!elem) {
            return stopParent;
        }

        var position = elem.style.position,
            excludeStaticParent = position === 'absolute',
            overflowRegex = /(auto|scroll)/,
            scrollParent = elem;

        while (!!scrollParent && scrollParent !== stopParent) {
            if (!(excludeStaticParent && scrollParent.style.position === 'static')) {
                var computedStyle = getComputedStyle(scrollParent);

                if (overflowRegex.test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) {
                    break;
                }
            }

            scrollParent = scrollParent.parentElement;
        }

        return position === 'fixed' || !scrollParent || scrollParent === elem ? elem.ownerDocument || stopParent : scrollParent;
    }
544062
function visible( element ) {
	var visibility = element.css( "visibility" );
	while ( visibility === "inherit" ) {
		element = element.parent();
		visibility = element.css( "visibility" );
	}
	return visibility !== "hidden";
}
1036804
function getFixedParent (el) {
    let currentParent = el.offsetParent,
        parent;

    while (parent === undefined) {

        if (currentParent === null) {
            parent = null;
            break;
        }

        if (css(currentParent, 'position') !== 'fixed') {
            currentParent = currentParent.offsetParent;
        } else {
            parent = currentParent;
        }
    }

    return parent;
}
1128363
protected CmsContainerElementBean getParentElement(CmsContainerElementBean element) {

        if (m_elementInstances == null) {
            initPageData();
        }
        CmsContainerElementBean parent = null;
        CmsContainerBean cont = m_parentContainers.get(element.getInstanceId());
        if ((cont != null) && cont.isNestedContainer()) {
            parent = m_elementInstances.get(cont.getParentInstanceId());
        }
        return parent;
    }
849971
def styleInheritedFromParent(node, style):
    
    parentNode = node.parentNode

    # return None if we reached the Document element
    if parentNode.nodeType == Node.DOCUMENT_NODE:
        return None

    # check styles first (they take precedence over presentation attributes)
    styles = _getStyle(parentNode)
    if style in styles:
        value = styles[style]
        if not value == 'inherit':
            return value

    # check attributes
    value = parentNode.getAttribute(style)
    if value not in ['', 'inherit']:
        return parentNode.getAttribute(style)

    # check the next parent recursively if we did not find a value yet
    return styleInheritedFromParent(parentNode, style)
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
1207672
function(element) {

      var x, link, image, text, fields;

      // set current element and node
      hashedit.current.element = element;
      hashedit.current.node = element;

      // if the current element is not a [hashedit-element], find the parent that matches
      if(hashedit.current.element.hasAttribute('hashedit-element') === false) {
        hashedit.current.element = hashedit.findParentBySelector(element, '[hashedit-element]');
      }

      // hide #hashedit-image
      image = document.querySelector('#hashedit-image-settings-modal');
      image.removeAttribute('visible');

      // hide #hashedit-link
      link = document.querySelector('#hashedit-link-settings-modal');
      link.removeAttribute('visible');

      // get #hashedit-config
      text = document.querySelector('#hashedit-text-settings');
      text.setAttribute('visible', '');

      // clear form fields
      fields = document.querySelectorAll('[data-model]');

      for (x = 0; x < fields.length; x += 1) {
        if (fields[x].nodeType == 'SELECT') {
          fields[x].selectedIndex = 0;
        } else {
          fields[x].value = '';
        }
      }

      hashedit.bind();

    }
148519
function getFixedPositionOffsetParent(element) {
  // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  if (!element || !element.parentElement || isIE()) {
    return document.documentElement;
  }
  var el = element.parentElement;
  while (el && getStyleComputedProperty(el, 'transform') === 'none') {
    el = el.parentElement;
  }
  return el || document.documentElement;
}
1257556
def style_and_context(element, element_id, &block)
      style_method = "#{element_id}_style"
      if parent_layout.respond_to?(style_method) || block_given?
        parent_layout.context(element) do
          if parent_layout.respond_to?(style_method)
            parent_layout.send(style_method)
          end

          if block_given?
            yield
          end
        end
      end
    end
537747
function() {
    var e = this._element;
    if (e) {
      var p = e.parentNode;
      if (p) {
        p.removeChild(e);
      }
    }
    return this;
  }
991577
function getClosestHeading($, headingsSelector, element) {
  const prevElements = $(element).prevAll();
  for (let i = 0; i < prevElements.length; i += 1) {
    const currentElement = $(prevElements[i]);
    if (currentElement.is(headingsSelector)) {
      return currentElement;
    }
    const childHeadings = currentElement.find(headingsSelector);
    if (childHeadings.length > 0) {
      return childHeadings.last();
    }
  }
  if ($(element).parent().length === 0) {
    return null;
  }
  return getClosestHeading($, headingsSelector, $(element).parent());
}
876892
def parent(self):
        
        def parent_element():
            """
            Wrapper to retrieve parent element
            """
            return WebElementWrapper(self.driver_wrapper, self.locator, self.element.parent)
        return self.execute_and_handle_webelement_exceptions(parent_element, 'get parent')