Examples of jsxGet_currentStyle()


Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

    public String jsxGet_fontSize() {
        String value = super.jsxGet_fontSize();
        if (value.length() == 0) {
            final HTMLElement parent = getElement().getParentHTMLElement();
            if (parent != null) {
                value = parent.jsxGet_currentStyle().jsxGet_fontSize();
            }
        }
        if (value.length() == 0) {
            value = "16px";
        }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

                // Inline elements take up however much space is required by their children.
                width = 0;
                for (DomNode child : this.<DomNode>getDomNodeOrDie().getChildren()) {
                    if (child.getScriptObject() instanceof HTMLElement) {
                        final HTMLElement e = (HTMLElement) child.getScriptObject();
                        final int w = e.jsxGet_currentStyle().getCalculatedWidth(true, true);
                        width += w;
                    }
                    else if (child.getScriptObject() instanceof Text) {
                        width += child.getTextContent().length() * PIXELS_PER_CHAR;
                    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

        Integer childrenHeight = null;
        for (DomNode child : this.<DomNode>getDomNodeOrDie().getChildren()) {
            if (child.getScriptObject() instanceof HTMLElement) {
                final HTMLElement e = (HTMLElement) child.getScriptObject();
                final int x = e.jsxGet_currentStyle().getCalculatedHeight(true, true);
                childrenHeight = (childrenHeight != null ? childrenHeight + x : x);
            }
        }

        int height;
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

            left = pixelValue(l);
        }
        else if ("absolute".equals(p) && !"auto".equals(r)) {
            // Need to calculate the horizontal displacement caused by *all* siblings.
            final HTMLElement parent = getElement().getParentHTMLElement();
            final int parentWidth = parent.jsxGet_currentStyle().getCalculatedWidth(false, false);
            left = parentWidth - pixelValue(r);
        }
        else if ("fixed".equals(p) && "auto".equals(l)) {
            // Fixed to the location at which the browser puts it via normal element flowing.
            final HTMLElement parent = getElement().getParentHTMLElement();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

            left = parentWidth - pixelValue(r);
        }
        else if ("fixed".equals(p) && "auto".equals(l)) {
            // Fixed to the location at which the browser puts it via normal element flowing.
            final HTMLElement parent = getElement().getParentHTMLElement();
            left = pixelValue(parent.jsxGet_currentStyle().getLeftWithInheritance());
        }
        else if ("static".equals(p)) {
            // We need to calculate the horizontal displacement caused by *previous* siblings.
            left = 0;
            for (DomNode n = getDomNodeOrDie(); n != null; n = n.getPreviousSibling()) {
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

            // We need to calculate the horizontal displacement caused by *previous* siblings.
            left = 0;
            for (DomNode n = getDomNodeOrDie(); n != null; n = n.getPreviousSibling()) {
                if (n.getScriptObject() instanceof HTMLElement) {
                    final HTMLElement e = (HTMLElement) n.getScriptObject();
                    final String d = e.jsxGet_currentStyle().jsxGet_display();
                    if ("block".equals(d)) {
                        break;
                    }
                    else if (!"none".equals(d)) {
                        left += e.jsxGet_currentStyle().getCalculatedWidth(true, true);
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

                    final String d = e.jsxGet_currentStyle().jsxGet_display();
                    if ("block".equals(d)) {
                        break;
                    }
                    else if (!"none".equals(d)) {
                        left += e.jsxGet_currentStyle().getCalculatedWidth(true, true);
                    }
                }
                else if (n.getScriptObject() instanceof Text) {
                    left += n.getTextContent().length() * PIXELS_PER_CHAR;
                }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

    public String getPositionWithInheritance() {
        String p = jsxGet_position();
        if ("inherit".equals(p)) {
            if (getBrowserVersion().hasFeature(CAN_INHERIT_CSS_PROPERTY_VALUES)) {
                final HTMLElement parent = getElement().getParentHTMLElement();
                p = (parent != null ? parent.jsxGet_currentStyle().getPositionWithInheritance() : "static");
            }
            else {
                p = "static";
            }
        }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

    public String getLeftWithInheritance() {
        String left = jsxGet_left();
        if ("inherit".equals(left)) {
            if (getBrowserVersion().hasFeature(CAN_INHERIT_CSS_PROPERTY_VALUES)) {
                final HTMLElement parent = getElement().getParentHTMLElement();
                left = (parent != null ? parent.jsxGet_currentStyle().getLeftWithInheritance() : "auto");
            }
            else {
                left = "auto";
            }
        }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.jsxGet_currentStyle()

    public String getRightWithInheritance() {
        String right = jsxGet_right();
        if ("inherit".equals(right)) {
            if (getBrowserVersion().hasFeature(CAN_INHERIT_CSS_PROPERTY_VALUES)) {
                final HTMLElement parent = getElement().getParentHTMLElement();
                right = (parent != null ? parent.jsxGet_currentStyle().getRightWithInheritance() : "auto");
            }
            else {
                right = "auto";
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.