summaryrefslogtreecommitdiffstats
path: root/WebCore/html
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html')
-rw-r--r--WebCore/html/HTMLFormControlElement.cpp18
-rw-r--r--WebCore/html/HTMLFormControlElement.h2
-rwxr-xr-xWebCore/html/canvas/DataView.h2
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp5
4 files changed, 22 insertions, 5 deletions
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index daf4b93..88b47ac 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -162,7 +162,6 @@ void HTMLFormControlElement::willMoveToNewOwnerDocument()
void HTMLFormControlElement::insertedIntoTree(bool deep)
{
if (fastHasAttribute(formAttr)) {
- document()->registerFormElementWithFormAttribute(this);
Element* element = document()->getElementById(fastGetAttribute(formAttr));
if (element && element->hasTagName(formTag)) {
if (m_form)
@@ -196,9 +195,6 @@ static inline Node* findRoot(Node* n)
void HTMLFormControlElement::removedFromTree(bool deep)
{
- if (fastHasAttribute(formAttr))
- document()->unregisterFormElementWithFormAttribute(this);
-
// If the form and element are both in the same tree, preserve the connection to the form.
// Otherwise, null out our form and remove ourselves from the form's list of elements.
if (m_form && findRoot(this) != findRoot(m_form)) {
@@ -209,6 +205,20 @@ void HTMLFormControlElement::removedFromTree(bool deep)
HTMLElement::removedFromTree(deep);
}
+void HTMLFormControlElement::insertedIntoDocument()
+{
+ if (fastHasAttribute(formAttr))
+ document()->registerFormElementWithFormAttribute(this);
+ HTMLElement::insertedIntoDocument();
+}
+
+void HTMLFormControlElement::removedFromDocument()
+{
+ if (fastHasAttribute(formAttr))
+ document()->unregisterFormElementWithFormAttribute(this);
+ HTMLElement::removedFromDocument();
+}
+
const AtomicString& HTMLFormControlElement::formControlName() const
{
const AtomicString& name = fastGetAttribute(nameAttr);
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index c5ed013..f006e65 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -109,6 +109,8 @@ protected:
virtual void attach();
virtual void insertedIntoTree(bool deep);
virtual void removedFromTree(bool deep);
+ virtual void insertedIntoDocument();
+ virtual void removedFromDocument();
virtual void willMoveToNewOwnerDocument();
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
diff --git a/WebCore/html/canvas/DataView.h b/WebCore/html/canvas/DataView.h
index 0681341..1c76c28 100755
--- a/WebCore/html/canvas/DataView.h
+++ b/WebCore/html/canvas/DataView.h
@@ -75,7 +75,7 @@ private:
DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength);
template<typename T>
- inline bool beyondRange(unsigned byteOffset) const { return byteOffset + sizeof(T) > m_byteLength; }
+ inline bool beyondRange(unsigned byteOffset) const { return byteOffset >= m_byteLength || byteOffset + sizeof(T) > m_byteLength; }
template<typename T>
T getData(unsigned byteOffset, bool littleEndian, ExceptionCode&) const;
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 3dd1453..237d80c 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1146,6 +1146,11 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
if (!count)
return;
+ if (!m_boundElementArrayBuffer) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
+
long numElements = 0;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state