/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** Create a new TD or TH element, the opposite type of the supplied aSourceCell *1.CopyallattributesfromaSourceCelltothenewcell *2.MoveallcontentsofaSourceCelltothenewcell *3.ReplaceaSourceCellinthetablewiththenewcell * *@paramaSourceCellThecelltobereplaced *@returnThenewcellthatreplacesaSourceCell
*/
[can_run_script]
Element switchTableCellHeaderType(in Element aSourceCell);
/** Split a cell that has rowspan and/or colspan > 0 *intocellssuchthatallnewcellshave *rowspan=1andcolspan=1 *Allofthecontentsarenottouched-- *theywillappeartobeintheupper-leftcell
*/
[can_run_script] void splitTableCell();
/** Scan through all rows and add cells as needed so *alllocationsinthecellmapareoccupied. *Usedafterinsertingsinglecellsorpasting *acollectionofcellsthatextendpastthe *previoussizeofthetable *IfaTableisnull,itusestableenclosingtheselectionanchor *Thisdoesn'tdoesn'tchangetheselection, *thusitcanbeusedtofixupalltables *inapageindependentoftheselection
*/
[can_run_script] void normalizeTable(in Element aTable);
/** *getCellIndexes()computesrowindexandcolumnindexofatablecell. *Notethatthisdependsonlayoutinformation.Therefore,allpending *layoutshould'vebeenflushedbeforecallingthis. * *@paramaCellElementIfnotnull,thiscomputesindexesofthecell. *Ifnull,thiscomputesindexesofacellwhich *containsanchorofSelection. *@paramaRowIndexMustbeanobject,whose.valuewillbeset *torowindexofthecell.0isthefirstrow. *Ifrowspanissetto2ormore,thestart *rowindexisused. *@paramaColumnIndexMustbeanobject,whose.valuewillbeset *tocolumnindexofthecell.0isthefirst *column.Ifcolspanissetto2ormore,the *startcolumnindexisused.
*/
[can_run_script] void getCellIndexes(in Element aCellElement,
out long aRowIndex, out long aColumnIndex);
/** *getTableSize()computesnumberofrowsandcolumns. *Notethatthisdependsonlayoutinformation.Therefore,allpending *layoutshould'vebeenflushedbeforecallingthis. * *@paramaTableOrElementInTableIfa<table>element,thiscomputesnumber *ofrowsandcolumnsofit. *Ifanotherelementandina<table>,this *computesnumberofrowsandcolumnsof *thenearestancestor<table>element. *Ifelementisnotin<table>element, *throwinganexception. *Ifnull,thislooksfornearestancestor *<table>elementcontaininganchorof *Selection.Iffound,computesthenumber *ofrowsandcolumnsofthe<table>. *Otherwise,throwinganexception. *@paramaRowCountNumberof*actual*rowcount. *I.e.,rowspandoesNOTincreasethisvalue. *@paramaColumnCountNumberofcolumncount. *I.e.,ifcolspanisspecifiedwithbigger *numberthanactual,thevalueisused *asthis.
*/
[can_run_script] void getTableSize(in Element aTableOrElementInTable,
out long aRowCount, out long aColCount);
/** *getCellAt()returnsa<td>or<th>elementina<table>ifthereisa *cellattheindexes. * *@paramaTableElementIfnotnull,mustbea<table>element. *Ifnull,looksforthenearestancestor<table> *tolookforacell. *@paramaRowIndexRowindexofthecell. *@paramaColumnIndexColumnindexofthecell. *@returnReturnsa<td>or<th>elementifthereis. *Otherwise,returnsnullwithoutthrowing *exception. *IfaTableElementisnotnullandnota<table> *element,throwinganexception. *IfaTableElementisnullandanchorofSelection *isnotinany<table>element,throwingan *exception.
*/
[can_run_script]
Element getCellAt(in Element aTableElement,
in long aRowIndex, in long aColumnIndex);
/** *Getcellelementanditsvariousinformationfrom<table>elementand *indexesinit.IfaTableElementisnull,thislooksforanancestor *<table>elementofanchorofSelection.Ifthereisno<table>element *atthatpoint,thisthrowsexception.Notethatthisrequireslayout *information.So,youneedtoflushthelayoutafterchangingtheDOM *tree. *Ifthereisnocellelementattheindexes,thisthrowsexception. *XXXPerhaps,thisiswrongbehavior,thisshouldreturnnullwithout *exceptionsincethecallercannotdistinguishwhethertheexception *iscausedby"notfound"orotherunexpectedsituation. * *@paramaTableElementA<table>element.Ifthisisnull,this *usesancestorofanchorofSelection. *@paramaRowIndexRowindexinaTableElement.Startingfrom0. *@paramaColumnIndexColumnindexinaTableElement.Startingfrom *0. *@paramaCellElement[OUT]Thecellelementattheindexes. *@paramaStartRowIndex[OUT]Firstrowindexwhichcontains *aCellElement.E.g.,ifthecell'srowspanis *not1,thisreturnsitsfirstrowindex. *I.e.,thiscanbesmallerthanaRowIndex. *@paramaStartColumnIndex[OUT]Firstcolumnindexwhichcontainsthe *aCellElement.E.g.,ifthecell'scolspanis *largerthan1,thisreturnsitsfirstcolumn *index.I.e.,thiscanbesmallerthan *aColumIndex. *@paramaRowSpan[OUT]rowspanattributevalueinmostcases. *Ifthespecifiedvalueisinvalid,this *returns1.Onlywhenthedocumentiswritten *inHTML5orlater,thiscanbe0. *@paramaColSpan[OUT]colspanattributevalueinmostcases. *Ifthespecifiedvalueisinvalid,this *returns1. *@paramaEffectiveRowSpan[OUT]EffectiverowspanvalueataRowIndex. *Thisissameas: *aRowSpan-(aRowIndex-aStartRowIndex) *@paramaEffectiveColSpan[OUT]EffectivecolspanvalueataColumnIndex. *Thisissameas: *aColSpan-(aColumnIndex-aStartColumnIndex) *@paramaIsSelected[OUT]ReturnstrueifaCellElementorits *<tr>or<table>elementisselected. *Otherwise,e.g.,aCellElementjustcontains *selectionrange,returnsfalse.
*/
[can_run_script] void getCellDataAt(in Element aTableElement,
in long aRowIndex, in long aColumnIndex,
out Element aCellElement,
out long aStartRowIndex, out long aStartColumnIndex,
out long aRowSpan, out long aColSpan,
out long aEffectiveRowSpan, out long aEffectiveColSpan,
out boolean aIsSelected);
/** Preferred direction to search for neighboring cell *whentryingtolocateacelltoplacecaretinafter *atableeditingaction. *UsedforaDirectionparaminSetSelectionAfterTableEdit
*/
/** *getSelectedOrParentTableElement()returnsa<td>,<th>,<tr>or<table>. *Iffirstselectionrangeselectsa<td>or<th>,returnsit.aTagName *issetto"td"eveniftheresultisa<th>andaCountissetto *Selection.rangeCount. *Iffirstselectionrangedoesnotselect<td>nor<th>,butselection *anchorrefers<table>,returnsit.aTagNameissetto"table"and *aCountissetto1. *Iffirstselectionrangedoesnotselect<td>nor<th>,butselection *anchorrefers<tr>,returnsit.aTagNameissetto"tr"andaCountis *setto1. *Iffirstselectionrangedoesnotselect<td>nor<th>,butselection *anchorrefers<td>(notinclude<th>!),returnsit.aTagNameissetto *"td"andaCountissetto0. *Otherwise,ifcontainerofselectionanchorisina<td>or<th>, *returnsit.aTagNameissetto"td"butaCountissetto0. *Otherwise,returnsnull,aTagNameissettoemptystringandaCountis *setto0.I.e.,doesnotthrowexceptionevenifacellisnotfound. *NOTE:CallingthisresetsinternalcounterofgetFirstSelectedCell() *andgetNextSelectedCell().I.e.,getNextSelectedCell()will *returnsecondselectedcellelement.
*/
[can_run_script]
Element getSelectedOrParentTableElement(out AString aTagName,
out long aCount);
/** Generally used after GetSelectedOrParentTableElement *totestifselectedcellsarecompleterowsorcolumns * *@paramaElementAnytableorcellelementoranyelement *insideatable *Usedtogetenclosingtable. *Ifnull,selection'sanchorNodeisused * *@return *0aCellElementwasnotacell *(returnedresult=NS_ERROR_FAILURE) *TableSelectionMode::CellThereare1ormorecellsselectedbut *completerowsorcolumnsarenotselected *TableSelectionMode::RowAllcellsarein1ormorerows *andineachrow,allcellsselected *Note:Thisisthevalueifallrows *(thusallcells)areselected *TableSelectionMode::ColumnAllcellsarein1ormorecolumns *andineachcolumn,allcellsareselected
*/
[can_run_script]
uint32_t getSelectedCellsType(in Element aElement);
/** *getFirstSelectedCellInTable()returnsacellelement,itsrowindexand *itscolumnindexiffirstrangeofSelectionselectsacell.Notethat *that"selectsacell"meansthattherangecontainerisa<tr>element *andendOffsetisstartOffset+1.So,eveniffirstrangeofSelection *isinacellelement,thistreatstherangedoesnotselectacell. *NOTE:CallingthisresetsinternalcounterofgetFirstSelectedCell() *andgetNextSelectedCell().I.e.,getNextSelectedCell()will *returnsecondselectedcellelement. * *@paramaRowIndex[OUT}Returnsrowindexofthefoundcell.Ifnot *found,returns0. *@paramaColumnIndex[OUT]Returnscolumnindexofthefoundcell.If *notfound,returns0. *@returnThecellelementwhichisselectedbythefirst *rangeofSelection.Evenifthisisnotfound, *thisreturnsnull,notthrowingexception.
*/
[can_run_script]
Element getFirstSelectedCellInTable(out long aRowIndex, out long aColIndex);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.