void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionCode& ec)
{
    if (newValue < 0)
        ec = INDEX_SIZE_ERR;
    else
        setIntegralAttribute(maxlengthAttr, newValue);
}
void HTMLBodyElement::didNotifySubtreeInsertionsToDocument()
{
    // FIXME: It's surprising this is web compatible since it means a
    // marginwidth and marginheight attribute can magically appear on the <body>
    // of all documents embedded through <iframe> or <frame>.
    HTMLFrameOwnerElement* ownerElement = document().ownerElement();
    if (!isHTMLFrameElementBase(ownerElement))
        return;
    HTMLFrameElementBase& ownerFrameElement = toHTMLFrameElementBase(*ownerElement);
    int marginWidth = ownerFrameElement.marginWidth();
    int marginHeight = ownerFrameElement.marginHeight();
    if (marginWidth != -1)
        setIntegralAttribute(marginwidthAttr, marginWidth);
    if (marginHeight != -1)
        setIntegralAttribute(marginheightAttr, marginHeight);
}
Beispiel #3
0
void HTMLMarqueeElement::setLoop(int value, ExceptionState& exceptionState) {
    if (value <= 0 && value != -1) {
        exceptionState.throwDOMException(
            IndexSizeError, "The provided value (" + String::number(value) +
            ") is neither positive nor -1.");
        return;
    }
    setIntegralAttribute(HTMLNames::loopAttr, value);
}
Beispiel #4
0
void HTMLMarqueeElement::setScrollDelay(int value,
                                        ExceptionState& exceptionState) {
    if (value < 0) {
        exceptionState.throwDOMException(
            IndexSizeError,
            "The provided value (" + String::number(value) + ") is negative.");
        return;
    }
    setIntegralAttribute(HTMLNames::scrolldelayAttr, value);
}
Beispiel #5
0
void HTMLTextAreaElement::setMinLength(int newValue, ExceptionState& exceptionState)
{
    int max = maxLength();
    if (newValue < 0)
        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(newValue) + ") is not positive or 0.");
    else if (max >= 0 && newValue > max)
        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("minLength", newValue, max));
    else
        setIntegralAttribute(minlengthAttr, newValue);
}
void HTMLTextAreaElement::setRows(int rows)
{
    setIntegralAttribute(rowsAttr, rows);
}
void HTMLTextAreaElement::setCols(int cols)
{
    setIntegralAttribute(colsAttr, cols);
}
Beispiel #8
0
void HTMLCanvasElement::setWidth(int value)
{
    setIntegralAttribute(HTMLNames::widthAttr, value);
}
Beispiel #9
0
void HTMLCanvasElement::setHeight(int value)
{
    setIntegralAttribute(HTMLNames::heightAttr, value);
}
Beispiel #10
0
void HTMLElement::setTabIndex(int value)
{
    setIntegralAttribute(tabindexAttr, value);
}