예제 #1
0
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);
}
예제 #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);
}
예제 #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);
}
예제 #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);
}
예제 #6
0
void HTMLTextAreaElement::setRows(int rows)
{
    setIntegralAttribute(rowsAttr, rows);
}
예제 #7
0
void HTMLTextAreaElement::setCols(int cols)
{
    setIntegralAttribute(colsAttr, cols);
}
예제 #8
0
void HTMLCanvasElement::setWidth(int value)
{
    setIntegralAttribute(HTMLNames::widthAttr, value);
}
예제 #9
0
void HTMLCanvasElement::setHeight(int value)
{
    setIntegralAttribute(HTMLNames::heightAttr, value);
}
예제 #10
0
void HTMLElement::setTabIndex(int value)
{
    setIntegralAttribute(tabindexAttr, value);
}