mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Backed out changeset 05ae078ca073 (bug 893117)
This commit is contained in:
parent
9c24e1a0d2
commit
90a6661c77
@ -6,6 +6,7 @@
|
|||||||
#include "mozilla/Util.h"
|
#include "mozilla/Util.h"
|
||||||
|
|
||||||
#include "mozilla/dom/HTMLTableElement.h"
|
#include "mozilla/dom/HTMLTableElement.h"
|
||||||
|
#include "nsIDOMHTMLTableSectionElement.h"
|
||||||
#include "nsAttrValueInlines.h"
|
#include "nsAttrValueInlines.h"
|
||||||
#include "nsRuleData.h"
|
#include "nsRuleData.h"
|
||||||
#include "nsHTMLStyleSheet.h"
|
#include "nsHTMLStyleSheet.h"
|
||||||
|
@ -47,15 +47,12 @@ NS_IMPL_ELEMENT_CLONE(HTMLTableRowElement)
|
|||||||
|
|
||||||
|
|
||||||
// protected method
|
// protected method
|
||||||
HTMLTableSectionElement*
|
already_AddRefed<nsIDOMHTMLTableSectionElement>
|
||||||
HTMLTableRowElement::GetSection() const
|
HTMLTableRowElement::GetSection() const
|
||||||
{
|
{
|
||||||
nsIContent* parent = GetParent();
|
nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
|
||||||
if (parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead ||
|
do_QueryInterface(GetParent());
|
||||||
parent->Tag() == nsGkAtoms::tfoot)) {
|
return section.forget();
|
||||||
return static_cast<HTMLTableSectionElement*>(parent);
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected method
|
// protected method
|
||||||
@ -107,12 +104,15 @@ HTMLTableRowElement::GetRowIndex(int32_t* aValue)
|
|||||||
int32_t
|
int32_t
|
||||||
HTMLTableRowElement::SectionRowIndex() const
|
HTMLTableRowElement::SectionRowIndex() const
|
||||||
{
|
{
|
||||||
HTMLTableSectionElement* section = GetSection();
|
nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
|
||||||
if (!section) {
|
if (!section) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIHTMLCollection> coll = section->Rows();
|
nsCOMPtr<nsIDOMHTMLCollection> rows;
|
||||||
|
section->GetRows(getter_AddRefs(rows));
|
||||||
|
|
||||||
|
nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
|
||||||
uint32_t numRows = coll->Length();
|
uint32_t numRows = coll->Length();
|
||||||
for (uint32_t i = 0; i < numRows; i++) {
|
for (uint32_t i = 0; i < numRows; i++) {
|
||||||
if (coll->GetElementAt(i) == this) {
|
if (coll->GetElementAt(i) == this) {
|
||||||
|
@ -10,13 +10,12 @@
|
|||||||
#include "nsIDOMHTMLTableRowElement.h"
|
#include "nsIDOMHTMLTableRowElement.h"
|
||||||
|
|
||||||
class nsIDOMHTMLTableElement;
|
class nsIDOMHTMLTableElement;
|
||||||
|
class nsIDOMHTMLTableSectionElement;
|
||||||
class nsContentList;
|
class nsContentList;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class HTMLTableSectionElement;
|
|
||||||
|
|
||||||
class HTMLTableRowElement MOZ_FINAL : public nsGenericHTMLElement,
|
class HTMLTableRowElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||||
public nsIDOMHTMLTableRowElement
|
public nsIDOMHTMLTableRowElement
|
||||||
{
|
{
|
||||||
@ -109,7 +108,7 @@ protected:
|
|||||||
virtual JSObject* WrapNode(JSContext *aCx,
|
virtual JSObject* WrapNode(JSContext *aCx,
|
||||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||||
|
|
||||||
HTMLTableSectionElement* GetSection() const;
|
already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection() const;
|
||||||
HTMLTableElement* GetTable() const;
|
HTMLTableElement* GetTable() const;
|
||||||
nsRefPtr<nsContentList> mCells;
|
nsRefPtr<nsContentList> mCells;
|
||||||
};
|
};
|
||||||
|
@ -37,12 +37,82 @@ NS_IMPL_RELEASE_INHERITED(HTMLTableSectionElement, Element)
|
|||||||
// QueryInterface implementation for HTMLTableSectionElement
|
// QueryInterface implementation for HTMLTableSectionElement
|
||||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableSectionElement)
|
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableSectionElement)
|
||||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||||
|
NS_INTERFACE_TABLE_INHERITED1(HTMLTableSectionElement,
|
||||||
|
nsIDOMHTMLTableSectionElement)
|
||||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||||
NS_ELEMENT_INTERFACE_MAP_END
|
NS_ELEMENT_INTERFACE_MAP_END
|
||||||
|
|
||||||
|
|
||||||
NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement)
|
NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement)
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::SetAlign(const nsAString& aAlign)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
SetAlign(aAlign, rv);
|
||||||
|
return rv.ErrorCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::GetAlign(nsAString& aAlign)
|
||||||
|
{
|
||||||
|
nsString align;
|
||||||
|
GetAlign(align);
|
||||||
|
aAlign = align;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::SetVAlign(const nsAString& aVAlign)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
SetVAlign(aVAlign, rv);
|
||||||
|
return rv.ErrorCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::GetVAlign(nsAString& aVAlign)
|
||||||
|
{
|
||||||
|
nsString vAlign;
|
||||||
|
GetVAlign(vAlign);
|
||||||
|
aVAlign = vAlign;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::SetCh(const nsAString& aCh)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
SetCh(aCh, rv);
|
||||||
|
return rv.ErrorCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::GetCh(nsAString& aCh)
|
||||||
|
{
|
||||||
|
nsString ch;
|
||||||
|
GetCh(ch);
|
||||||
|
aCh = ch;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::SetChOff(const nsAString& aChOff)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
SetChOff(aChOff, rv);
|
||||||
|
return rv.ErrorCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::GetChOff(nsAString& aChOff)
|
||||||
|
{
|
||||||
|
nsString chOff;
|
||||||
|
GetChOff(chOff);
|
||||||
|
aChOff = chOff;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsIHTMLCollection*
|
nsIHTMLCollection*
|
||||||
HTMLTableSectionElement::Rows()
|
HTMLTableSectionElement::Rows()
|
||||||
{
|
{
|
||||||
@ -57,6 +127,13 @@ HTMLTableSectionElement::Rows()
|
|||||||
return mRows;
|
return mRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
|
||||||
|
{
|
||||||
|
NS_ADDREF(*aValue = Rows());
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
already_AddRefed<nsGenericHTMLElement>
|
already_AddRefed<nsGenericHTMLElement>
|
||||||
HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
||||||
{
|
{
|
||||||
@ -95,6 +172,15 @@ HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
|||||||
return rowContent.forget();
|
return rowContent.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::InsertRow(int32_t aIndex,
|
||||||
|
nsIDOMHTMLElement** aValue)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
nsRefPtr<nsGenericHTMLElement> row = InsertRow(aIndex, rv);
|
||||||
|
return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(row, aValue);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
|
HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
|
||||||
{
|
{
|
||||||
@ -127,6 +213,14 @@ HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
|
|||||||
nsINode::RemoveChild(*row, aError);
|
nsINode::RemoveChild(*row, aError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
HTMLTableSectionElement::DeleteRow(int32_t aValue)
|
||||||
|
{
|
||||||
|
ErrorResult rv;
|
||||||
|
DeleteRow(aValue, rv);
|
||||||
|
return rv.ErrorCode();
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
|
HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
|
@ -7,13 +7,14 @@
|
|||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
|
#include "nsIDOMHTMLTableSectionElement.h"
|
||||||
#include "nsContentList.h" // For ctor.
|
#include "nsContentList.h" // For ctor.
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class HTMLTableSectionElement MOZ_FINAL : public nsGenericHTMLElement,
|
class HTMLTableSectionElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||||
public nsIDOMHTMLElement
|
public nsIDOMHTMLTableSectionElement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||||
@ -33,6 +34,9 @@ public:
|
|||||||
// nsIDOMHTMLElement
|
// nsIDOMHTMLElement
|
||||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||||
|
|
||||||
|
// nsIDOMHTMLTableSectionElement
|
||||||
|
NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
|
||||||
|
|
||||||
nsIHTMLCollection* Rows();
|
nsIHTMLCollection* Rows();
|
||||||
already_AddRefed<nsGenericHTMLElement>
|
already_AddRefed<nsGenericHTMLElement>
|
||||||
InsertRow(int32_t aIndex, ErrorResult& aError);
|
InsertRow(int32_t aIndex, ErrorResult& aError);
|
||||||
|
@ -73,6 +73,7 @@ interface nsIDOMRect;
|
|||||||
interface nsIDOMCSSStyleRule;
|
interface nsIDOMCSSStyleRule;
|
||||||
interface nsIDOMCSSStyleRuleCollection;
|
interface nsIDOMCSSStyleRuleCollection;
|
||||||
interface nsIDOMHTMLTableCaptionElement;
|
interface nsIDOMHTMLTableCaptionElement;
|
||||||
|
interface nsIDOMHTMLTableSectionElement;
|
||||||
|
|
||||||
// Range
|
// Range
|
||||||
interface nsIDOMRange;
|
interface nsIDOMRange;
|
||||||
|
@ -65,6 +65,7 @@ XPIDL_SOURCES += [
|
|||||||
'nsIDOMHTMLTableColElement.idl',
|
'nsIDOMHTMLTableColElement.idl',
|
||||||
'nsIDOMHTMLTableElement.idl',
|
'nsIDOMHTMLTableElement.idl',
|
||||||
'nsIDOMHTMLTableRowElement.idl',
|
'nsIDOMHTMLTableRowElement.idl',
|
||||||
|
'nsIDOMHTMLTableSectionElement.idl',
|
||||||
'nsIDOMHTMLTextAreaElement.idl',
|
'nsIDOMHTMLTextAreaElement.idl',
|
||||||
'nsIDOMHTMLTitleElement.idl',
|
'nsIDOMHTMLTitleElement.idl',
|
||||||
'nsIDOMHTMLUListElement.idl',
|
'nsIDOMHTMLUListElement.idl',
|
||||||
|
33
dom/interfaces/html/nsIDOMHTMLTableSectionElement.idl
Normal file
33
dom/interfaces/html/nsIDOMHTMLTableSectionElement.idl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "nsIDOMHTMLElement.idl"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The nsIDOMHTMLTableSectionElement interface is the interface to a
|
||||||
|
* [X]HTML thead, tbody, and tfoot element.
|
||||||
|
*
|
||||||
|
* This interface is trying to follow the DOM Level 2 HTML specification:
|
||||||
|
* http://www.w3.org/TR/DOM-Level-2-HTML/
|
||||||
|
*
|
||||||
|
* with changes from the work-in-progress WHATWG HTML specification:
|
||||||
|
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||||
|
*/
|
||||||
|
|
||||||
|
[scriptable, builtinclass, uuid(7b91cf4c-5194-4122-bc29-7bbd18ba0020)]
|
||||||
|
interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
|
||||||
|
{
|
||||||
|
attribute DOMString align;
|
||||||
|
attribute DOMString ch;
|
||||||
|
attribute DOMString chOff;
|
||||||
|
attribute DOMString vAlign;
|
||||||
|
readonly attribute nsIDOMHTMLCollection rows;
|
||||||
|
// Modified in DOM Level 2:
|
||||||
|
nsIDOMHTMLElement insertRow(in long index)
|
||||||
|
raises(DOMException);
|
||||||
|
// Modified in DOM Level 2:
|
||||||
|
void deleteRow(in long index)
|
||||||
|
raises(DOMException);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user