Element extends Node<Element> { public Style getStyle() { return getStateProvider().getStyle(getNode()); } protected  Element(StateNode node, ElementStateProvider stateProvider);  Element(String tag); static Element get(StateNode node); static Element get(StateNode node,
            ElementStateProvider stateProvider); @Override int getChildCount(); @Override Element getChild(int index); @Override Stream<Element> getChildren(); static Element createText(String text); String getTag(); Element setAttribute(String attribute, String value); Element setAttribute(String attribute, boolean value); Element setAttribute(String attribute,
            AbstractStreamResource resource); String getAttribute(String attribute); boolean hasAttribute(String attribute); Stream<String> getAttributeNames(); Element removeAttribute(String attribute); DomListenerRegistration addEventListener(String eventType,
            DomEventListener listener); Element removeFromParent(); Element removeFromTree(); Element getParent(); Element setProperty(String name, String value); Element setProperty(String name, boolean value); Element setProperty(String name, double value); Element setPropertyJson(String name, JsonValue value); Element setPropertyBean(String name, Object value); Element setPropertyList(String name, List<T> value); Element setPropertyMap(String name, Map<String, ?> value); Registration addPropertyChangeListener(String name,
            PropertyChangeListener listener); DomListenerRegistration addPropertyChangeListener(
            String propertyName, String domEventName,
            PropertyChangeListener listener); String getProperty(String name, String defaultValue); String getProperty(String name); boolean getProperty(String name, boolean defaultValue); double getProperty(String name, double defaultValue); int getProperty(String name, int defaultValue); Serializable getPropertyRaw(String name); Element removeProperty(String name); boolean hasProperty(String name); Stream<String> getPropertyNames(); boolean isTextNode(); Element setText(String textContent); String getText(); String getTextRecursively(); ClassList getClassList(); ThemeList getThemeList(); Style getStyle(); Optional<Component> getComponent(); Registration addAttachListener(
            ElementAttachListener attachListener); Registration addDetachListener(
            ElementDetachListener detachListener); @Override String toString(); String getOuterHTML(); T as(Class<T> componentType); @Deprecated void callFunction(String functionName, Serializable... arguments); PendingJavaScriptResult callJsFunction(String functionName,
            Serializable... arguments); @Deprecated void executeJavaScript(String expression,
            Serializable... parameters); PendingJavaScriptResult executeJs(String expression,
            Serializable... parameters); ShadowRoot attachShadow(); Optional<ShadowRoot> getShadowRoot(); Element setVisible(boolean visible); boolean isVisible(); Element setEnabled(final boolean enabled); boolean isEnabled();  }
@Test(expected = IllegalArgumentException.class) public void semicolonInStyle() { Element e = ElementFactory.createDiv(); Style s = e.getStyle(); s.set("border", "1 px solid black;"); }
@Test(expected = IllegalArgumentException.class) public void setEmptyStyleName() { Element e = ElementFactory.createDiv(); e.getStyle().set("", "foo"); }
@Test(expected = IllegalArgumentException.class) public void setStyleNameExtraWhitespace() { Element e = ElementFactory.createDiv(); e.getStyle().set(" color", "red"); }
@Test(expected = IllegalArgumentException.class) public void setStyleNameColon() { Element e = ElementFactory.createDiv(); e.getStyle().set("color:", "red"); }
@Test public void dashSeparatedHasStyle() { Element element = ElementFactory.createDiv(); Style style = element.getStyle(); style.set("borderColor", "blue"); style.set("border-foo", "bar"); Assert.assertTrue(style.has("border-color")); Assert.assertTrue(style.has("border-foo")); }
@Test public void dashSeparatedRemoveStyle() { Element element = ElementFactory.createDiv(); Style style = element.getStyle(); style.set("borderColor", "blue"); style.set("border-foo", "bar"); style.remove("border-color"); style.remove("border-foo"); Assert.assertFalse(style.has("border-color")); Assert.assertFalse(style.has("border-foo")); }
@Test public void styleGetNamesDashAndCamelCase() { Element element = ElementFactory.createDiv(); Style style = element.getStyle(); style.set("borderColor", "blue"); style.set("border-foo", "bar"); List<String> styles = style.getNames().collect(Collectors.toList()); Assert.assertEquals(2, styles.size()); Assert.assertTrue(styles.contains("border-color")); Assert.assertTrue(styles.contains("border-foo")); }
@Test public void nullStyleValue() { Element element = ElementFactory.createDiv(); Style style = element.getStyle(); style.set("borderColor", "blue"); style.set("borderColor", null); List<String> styles = style.getNames().collect(Collectors.toList()); Assert.assertFalse(styles.contains("borderColor")); }