[CTTE] Node subclasses should take a Document by reference in their constructor (Part 4)
https://bugs.webkit.org/show_bug.cgi?id=121372

Reviewed by Eric Carlson.

Converts the following to take a Document reference:
    - HTMLFormControlElement
    - HTMLFormControlElementWithState
    - HTMLMapElement
    - HTMLMarqueeElement
    - HTMLMediaElement
    - HTMLMenuElement
    - HTMLMetaElement
    - HTMLMeterElement
    - HTMLOListElement
    - HTMLObjectElement
    - HTMLOptGroupElement
    - HTMLOptionElement
    - HTMLOutputElement
    - HTMLParagraphElement
    - HTMLParamElement
    - HTMLProgressElement
    - HTMLScriptElement
    - HTMLSelectElement
    - HTMLSourceElement
    - HTMLSpanElement
    - HTMLStyleElement
    - HTMLSummaryElement
    - HTMLTableCellElement
    - HTMLTableElement
    - HTMLTableRowElement
    - HTMLTableSectionElement
    - HTMLTemplateElement
    - HTMLTextAreaElement
    - HTMLTextFormControlElement
    - HTMLTitleElement
    - HTMLTrackElement
    - HTMLUListElement
    - InlineStyleSheetOwner
    - LabelableElement
    - All the MediaControl elements


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp
index dc5351b..7ded32d 100644
--- a/Source/WebCore/html/HTMLTableElement.cpp
+++ b/Source/WebCore/html/HTMLTableElement.cpp
@@ -46,8 +46,8 @@
 
 using namespace HTMLNames;
 
-HTMLTableElement::HTMLTableElement(const QualifiedName& tagName, Document* document)
-    : HTMLElement(tagName, document)
+HTMLTableElement::HTMLTableElement(const QualifiedName& tagName, Document& document)
+    : HTMLElement(tagName, &document)
     , m_borderAttr(false)
     , m_borderColorAttr(false)
     , m_frameAttr(false)
@@ -57,12 +57,12 @@
     ASSERT(hasTagName(tableTag));
 }
 
-PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document* document)
+PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document& document)
 {
     return adoptRef(new HTMLTableElement(tableTag, document));
 }
 
-PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagName, Document* document)
+PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagName, Document& document)
 {
     return adoptRef(new HTMLTableElement(tagName, document));
 }
@@ -128,7 +128,7 @@
 {
     if (HTMLTableSectionElement* existingHead = tHead())
         return existingHead;
-    RefPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(theadTag, &document());
+    RefPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(theadTag, document());
     setTHead(head, IGNORE_EXCEPTION);
     return head.release();
 }
@@ -142,7 +142,7 @@
 {
     if (HTMLTableSectionElement* existingFoot = tFoot())
         return existingFoot;
-    RefPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::create(tfootTag, &document());
+    RefPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::create(tfootTag, document());
     setTFoot(foot, IGNORE_EXCEPTION);
     return foot.release();
 }
@@ -154,7 +154,7 @@
 
 PassRefPtr<HTMLElement> HTMLTableElement::createTBody()
 {
-    RefPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbodyTag, &document());
+    RefPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbodyTag, document());
     Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0;
     insertBefore(body, referenceElement, ASSERT_NO_EXCEPTION);
     return body.release();
@@ -216,15 +216,15 @@
     else {
         parent = lastBody();
         if (!parent) {
-            RefPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::create(tbodyTag, &document());
-            RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(&document());
+            RefPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::create(tbodyTag, document());
+            RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
             newBody->appendChild(newRow, ec);
             appendChild(newBody.release(), ec);
             return newRow.release();
         }
     }
 
-    RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(&document());
+    RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
     parent->insertBefore(newRow, row.get(), ec);
     return newRow.release();
 }