/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.gwt.elemento.core.builder;

import elemental2.dom.HTMLElement;
import elemental2.dom.Node;
import org.gwtproject.safehtml.shared.SafeHtml;
import org.jboss.gwt.elemento.core.IsElement;

/** Builder for container-like elements with inner HTML. */
public interface HtmlContent<E extends HTMLElement, B extends TypedBuilder<E, B>> extends TextContent<E, B> {

    /** Sets the inner HTML on the element using {@link HTMLElement#innerHTML}. */
    default B innerHtml(SafeHtml html) {
        get().innerHTML = html.asString();
        return that();
    }


    // ------------------------------------------------------ child element(s)

    /** Adds the given element by calling {@code element.element()}. */
    default B add(IsElement element) {
        return add(element.element());
    }

    /** Adds the given text as a text node. */
    default B add(String text) {
        return add(get().ownerDocument.createTextNode(text));
    }

    /** Adds the given element. */
    default B add(Node element) {
        get().appendChild(element);
        return that();
    }

    /** Adds all elements. */
    default B addAll(HTMLElement... elements) {
        for (HTMLElement element : elements) {
            add(element);
        }
        return that();
    }

    /** Adds all elements. */
    default B addAll(Iterable<? extends Node> elements) {
        for (Node element : elements) {
            add(element);
        }
        return that();
    }

    /** Adds all elements. */
    default B addAll(IsElement... elements) {
        for (IsElement element : elements) {
            add(element);
        }
        return that();
    }
}

@@ -708,16 +708,64 @@
 feHtml;%0A
+import org.jboss.gwt.elemento.core.HasElements;%0A
 import o
@@ -1876,32 +1876,333 @@
  that();%0A    %7D%0A%0A
+    /**%0A     * Adds all elements.%0A     *%0A     * @deprecated Please use %7B@link #addAll(Iterable)%7D instead.%0A     */%0A    @Deprecated%0A    default B addAll(HasElements elements) %7B%0A        for (HTMLElement element : elements.asElements()) %7B%0A            add(element);%0A        %7D%0A        return that();%0A    %7D%0A%0A
     /** Adds all

Make API changes backward compatible