2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2011-10-11 09:50:08 +04:00
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
#include "mozilla/dom/HTMLTableRowElement.h"
|
2012-12-29 18:07:57 +04:00
|
|
|
#include "mozilla/dom/HTMLTableElement.h"
|
2017-01-27 03:51:01 +03:00
|
|
|
#include "mozilla/GenericSpecifiedValuesInlines.h"
|
2004-01-26 22:22:05 +03:00
|
|
|
#include "nsMappedAttributes.h"
|
2012-09-30 20:40:24 +04:00
|
|
|
#include "nsAttrValueInlines.h"
|
2012-12-29 18:07:57 +04:00
|
|
|
#include "mozilla/dom/BindingUtils.h"
|
|
|
|
#include "mozilla/dom/HTMLTableRowElementBinding.h"
|
2013-02-01 03:11:49 +04:00
|
|
|
#include "nsContentList.h"
|
|
|
|
#include "nsContentUtils.h"
|
1998-12-18 20:05:17 +03:00
|
|
|
|
2004-05-19 00:58:12 +04:00
|
|
|
NS_IMPL_NS_NEW_HTML_ELEMENT(TableRow)
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2014-07-09 01:23:16 +04:00
|
|
|
HTMLTableRowElement::~HTMLTableRowElement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
HTMLTableRowElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return HTMLTableRowElementBinding::Wrap(aCx, this, aGivenProto);
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2013-08-02 05:29:05 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLTableRowElement)
|
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLTableRowElement,
|
2007-03-08 14:17:16 +03:00
|
|
|
nsGenericHTMLElement)
|
2012-11-15 11:32:40 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCells)
|
2007-03-08 14:17:16 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
NS_IMPL_ADDREF_INHERITED(HTMLTableRowElement, Element)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(HTMLTableRowElement, Element)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
// QueryInterface implementation for HTMLTableRowElement
|
2013-08-02 02:24:22 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTableRowElement)
|
2013-08-08 00:23:08 +04:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
|
1998-09-02 04:56:01 +04:00
|
|
|
|
|
|
|
|
2012-12-28 06:45:57 +04:00
|
|
|
NS_IMPL_ELEMENT_CLONE(HTMLTableRowElement)
|
2000-12-23 13:56:31 +03:00
|
|
|
|
1998-09-02 04:56:01 +04:00
|
|
|
|
1998-12-18 20:05:17 +03:00
|
|
|
// protected method
|
2013-08-02 02:24:22 +04:00
|
|
|
HTMLTableSectionElement*
|
2012-12-28 06:45:57 +04:00
|
|
|
HTMLTableRowElement::GetSection() const
|
1998-12-18 20:05:17 +03:00
|
|
|
{
|
2013-08-02 02:24:22 +04:00
|
|
|
nsIContent* parent = GetParent();
|
2015-03-03 14:09:00 +03:00
|
|
|
if (parent &&
|
|
|
|
parent->IsAnyOfHTMLElements(nsGkAtoms::thead,
|
|
|
|
nsGkAtoms::tbody,
|
|
|
|
nsGkAtoms::tfoot)) {
|
2013-08-02 02:24:22 +04:00
|
|
|
return static_cast<HTMLTableSectionElement*>(parent);
|
|
|
|
}
|
|
|
|
return nullptr;
|
1998-12-18 20:05:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// protected method
|
2012-12-29 18:07:57 +04:00
|
|
|
HTMLTableElement*
|
2012-12-28 06:45:57 +04:00
|
|
|
HTMLTableRowElement::GetTable() const
|
1998-12-18 20:05:17 +03:00
|
|
|
{
|
2011-11-16 11:50:19 +04:00
|
|
|
nsIContent* parent = GetParent();
|
|
|
|
if (!parent) {
|
2012-09-06 11:14:49 +04:00
|
|
|
return nullptr;
|
2003-07-03 06:47:33 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2005-02-08 23:20:08 +03:00
|
|
|
// We may not be in a section
|
2012-12-29 18:07:57 +04:00
|
|
|
HTMLTableElement* table = HTMLTableElement::FromContent(parent);
|
2011-11-16 11:50:19 +04:00
|
|
|
if (table) {
|
2012-12-29 18:07:57 +04:00
|
|
|
return table;
|
2005-02-08 23:20:08 +03:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
return HTMLTableElement::FromContentOrNull(parent->GetParent());
|
1998-12-18 20:05:17 +03:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
int32_t
|
|
|
|
HTMLTableRowElement::RowIndex() const
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2012-12-29 18:07:57 +04:00
|
|
|
HTMLTableElement* table = GetTable();
|
2012-09-06 11:14:49 +04:00
|
|
|
if (!table) {
|
2012-12-29 18:07:57 +04:00
|
|
|
return -1;
|
2011-11-16 11:50:19 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsIHTMLCollection* rows = table->Rows();
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
uint32_t numRows = rows->Length();
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0; i < numRows; i++) {
|
2012-12-29 18:07:57 +04:00
|
|
|
if (rows->GetElementAt(i) == this) {
|
|
|
|
return i;
|
1998-12-18 20:05:17 +03:00
|
|
|
}
|
|
|
|
}
|
2012-12-29 18:07:57 +04:00
|
|
|
|
|
|
|
return -1;
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
int32_t
|
|
|
|
HTMLTableRowElement::SectionRowIndex() const
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2013-08-02 02:24:22 +04:00
|
|
|
HTMLTableSectionElement* section = GetSection();
|
2012-09-06 11:14:49 +04:00
|
|
|
if (!section) {
|
2012-12-29 18:07:57 +04:00
|
|
|
return -1;
|
2011-11-16 11:50:19 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2013-08-02 02:24:22 +04:00
|
|
|
nsCOMPtr<nsIHTMLCollection> coll = section->Rows();
|
2012-10-13 16:50:24 +04:00
|
|
|
uint32_t numRows = coll->Length();
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0; i < numRows; i++) {
|
2012-10-13 16:50:24 +04:00
|
|
|
if (coll->GetElementAt(i) == this) {
|
2012-12-29 18:07:57 +04:00
|
|
|
return i;
|
2011-11-16 11:50:19 +04:00
|
|
|
}
|
1998-12-18 20:05:17 +03:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool
|
2017-02-14 00:06:45 +03:00
|
|
|
IsCell(Element *aElement, int32_t aNamespaceID,
|
2007-02-01 18:14:00 +03:00
|
|
|
nsIAtom* aAtom, void *aData)
|
2004-04-14 08:26:00 +04:00
|
|
|
{
|
2017-02-14 00:06:45 +03:00
|
|
|
return aElement->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th);
|
2004-04-14 08:26:00 +04:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsIHTMLCollection*
|
|
|
|
HTMLTableRowElement::Cells()
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2000-12-23 13:56:31 +03:00
|
|
|
if (!mCells) {
|
2006-07-02 11:23:10 +04:00
|
|
|
mCells = new nsContentList(this,
|
2004-04-14 08:26:00 +04:00
|
|
|
IsCell,
|
2012-07-30 18:20:58 +04:00
|
|
|
nullptr, // destroy func
|
|
|
|
nullptr, // closure data
|
2011-10-17 18:59:28 +04:00
|
|
|
false,
|
2012-07-30 18:20:58 +04:00
|
|
|
nullptr,
|
2009-03-20 17:58:37 +03:00
|
|
|
kNameSpaceID_XHTML,
|
2011-10-17 18:59:28 +04:00
|
|
|
false);
|
1998-12-18 20:05:17 +03:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
return mCells;
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
already_AddRefed<nsGenericHTMLElement>
|
|
|
|
HTMLTableRowElement::InsertCell(int32_t aIndex,
|
|
|
|
ErrorResult& aError)
|
|
|
|
{
|
2002-12-17 16:29:39 +03:00
|
|
|
if (aIndex < -1) {
|
2012-12-29 18:07:57 +04:00
|
|
|
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
|
|
|
return nullptr;
|
2002-12-17 16:29:39 +03:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2009-07-10 01:09:44 +04:00
|
|
|
// Make sure mCells is initialized.
|
2012-12-29 18:07:57 +04:00
|
|
|
nsIHTMLCollection* cells = Cells();
|
2001-12-23 19:21:10 +03:00
|
|
|
|
2009-07-10 01:09:44 +04:00
|
|
|
NS_ASSERTION(mCells, "How did that happen?");
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsCOMPtr<nsINode> nextSibling;
|
2009-07-10 01:09:44 +04:00
|
|
|
// -1 means append, so should use null nextSibling
|
|
|
|
if (aIndex != -1) {
|
2012-12-29 18:07:57 +04:00
|
|
|
nextSibling = cells->Item(aIndex);
|
2009-07-10 01:09:44 +04:00
|
|
|
// Check whether we're inserting past end of list. We want to avoid doing
|
|
|
|
// this unless we really have to, since this has to walk all our kids. If
|
|
|
|
// we have a nextSibling, we're clearly not past end of list.
|
|
|
|
if (!nextSibling) {
|
2012-12-29 18:07:57 +04:00
|
|
|
uint32_t cellCount = cells->Length();
|
2012-08-22 19:56:38 +04:00
|
|
|
if (aIndex > int32_t(cellCount)) {
|
2012-12-29 18:07:57 +04:00
|
|
|
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
|
|
|
return nullptr;
|
2009-07-10 01:09:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-05-03 18:57:00 +04:00
|
|
|
|
2000-12-23 13:56:31 +03:00
|
|
|
// create the cell
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::NodeInfo> nodeInfo;
|
2017-02-21 06:44:00 +03:00
|
|
|
nsContentUtils::QNameChanged(mNodeInfo, nsGkAtoms::td,
|
|
|
|
getter_AddRefs(nodeInfo));
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsGenericHTMLElement> cell =
|
2012-12-29 18:07:57 +04:00
|
|
|
NS_NewHTMLTableCellElement(nodeInfo.forget());
|
|
|
|
if (!cell) {
|
|
|
|
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
return nullptr;
|
2004-06-06 06:38:32 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsINode::InsertBefore(*cell, nextSibling, aError);
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
return cell.forget();
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
void
|
|
|
|
HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError)
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2002-12-17 16:29:39 +03:00
|
|
|
if (aValue < -1) {
|
2012-12-29 18:07:57 +04:00
|
|
|
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
|
|
|
return;
|
2002-12-17 16:29:39 +03:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsIHTMLCollection* cells = Cells();
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t refIndex;
|
2002-12-17 16:29:39 +03:00
|
|
|
if (aValue == -1) {
|
2012-12-29 18:07:57 +04:00
|
|
|
refIndex = cells->Length();
|
2002-12-17 16:29:39 +03:00
|
|
|
if (refIndex == 0) {
|
2012-12-29 18:07:57 +04:00
|
|
|
return;
|
2002-12-17 16:29:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
--refIndex;
|
|
|
|
}
|
|
|
|
else {
|
2012-08-22 19:56:38 +04:00
|
|
|
refIndex = (uint32_t)aValue;
|
2002-12-17 16:29:39 +03:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsCOMPtr<nsINode> cell = cells->Item(refIndex);
|
2001-12-23 19:21:10 +03:00
|
|
|
if (!cell) {
|
2012-12-29 18:07:57 +04:00
|
|
|
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
|
|
|
return;
|
2000-12-23 13:56:31 +03:00
|
|
|
}
|
|
|
|
|
2012-12-29 18:07:57 +04:00
|
|
|
nsINode::RemoveChild(*cell, aError);
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2012-12-28 06:45:57 +04:00
|
|
|
HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
nsAttrValue& aResult)
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2002-09-11 05:57:40 +04:00
|
|
|
/*
|
|
|
|
* ignore these attributes, stored simply as strings
|
|
|
|
*
|
|
|
|
* ch
|
1998-09-15 21:58:24 +04:00
|
|
|
*/
|
2002-09-11 05:57:40 +04:00
|
|
|
|
2005-11-29 19:37:15 +03:00
|
|
|
if (aNamespaceID == kNameSpaceID_None) {
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::charoff) {
|
2005-11-29 19:37:15 +03:00
|
|
|
return aResult.ParseIntWithBounds(aValue, 0);
|
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::height) {
|
2011-02-04 22:46:16 +03:00
|
|
|
return aResult.ParseSpecialIntValue(aValue);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::width) {
|
2011-02-04 22:46:16 +03:00
|
|
|
return aResult.ParseSpecialIntValue(aValue);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::align) {
|
2005-11-29 19:37:15 +03:00
|
|
|
return ParseTableCellHAlignValue(aValue, aResult);
|
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::bgcolor) {
|
2010-07-17 12:09:14 +04:00
|
|
|
return aResult.ParseColor(aValue);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::valign) {
|
2005-11-29 19:37:15 +03:00
|
|
|
return ParseTableVAlignValue(aValue, aResult);
|
|
|
|
}
|
1998-09-15 21:58:24 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2012-08-24 21:50:49 +04:00
|
|
|
return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
|
|
|
|
aAttribute, aValue,
|
|
|
|
aResult) ||
|
|
|
|
nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
2005-11-29 19:37:15 +03:00
|
|
|
aResult);
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2013-11-19 23:21:29 +04:00
|
|
|
void
|
|
|
|
HTMLTableRowElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
2017-01-27 03:51:01 +03:00
|
|
|
GenericSpecifiedValues* aData)
|
1998-09-02 04:56:01 +04:00
|
|
|
{
|
2017-01-27 03:51:01 +03:00
|
|
|
nsGenericHTMLElement::MapHeightAttributeInto(aAttributes, aData);
|
|
|
|
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
|
|
|
|
nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aData);
|
|
|
|
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
|
|
|
|
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
|
1998-09-02 04:56:01 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP_(bool)
|
2012-12-28 06:45:57 +04:00
|
|
|
HTMLTableRowElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
1999-07-07 05:24:40 +04:00
|
|
|
{
|
2004-02-26 00:04:50 +03:00
|
|
|
static const MappedAttributeEntry attributes[] = {
|
2006-12-26 20:47:52 +03:00
|
|
|
{ &nsGkAtoms::align },
|
2017-07-06 15:00:35 +03:00
|
|
|
{ &nsGkAtoms::valign },
|
2006-12-26 20:47:52 +03:00
|
|
|
{ &nsGkAtoms::height },
|
2012-07-30 18:20:58 +04:00
|
|
|
{ nullptr }
|
2003-04-17 00:54:20 +04:00
|
|
|
};
|
|
|
|
|
2004-02-26 00:04:50 +03:00
|
|
|
static const MappedAttributeEntry* const map[] = {
|
2003-04-17 00:54:20 +04:00
|
|
|
attributes,
|
|
|
|
sCommonAttributeMap,
|
|
|
|
sBackgroundAttributeMap,
|
|
|
|
};
|
|
|
|
|
2011-12-18 14:09:27 +04:00
|
|
|
return FindAttributeDependence(aAttribute, map);
|
1999-07-07 05:24:40 +04:00
|
|
|
}
|
|
|
|
|
2005-01-12 22:45:38 +03:00
|
|
|
nsMapRuleToAttributesFunc
|
2012-12-28 06:45:57 +04:00
|
|
|
HTMLTableRowElement::GetAttributeMappingFunction() const
|
1998-09-05 08:00:06 +04:00
|
|
|
{
|
2005-01-12 22:45:38 +03:00
|
|
|
return &MapAttributesIntoRule;
|
1998-09-05 08:00:06 +04:00
|
|
|
}
|
2012-12-28 06:45:57 +04:00
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|