Closed
Bug 204589
Opened 21 years ago
Closed 3 years ago
new rows inserted in a table do not inherit the class attribute from the previous row
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: pascalc, Assigned: laurent)
Details
Attachments
(1 file, 1 obsolete file)
37.52 KB,
patch
|
Details | Diff | Splinter Review |
build 2003043008 winXP 1 edit a table in composer with some cells having a class attribute (like <tr><td></td><td class="foo"></td></tr>) 2 insert a new row from context menu (table insert/row blelow) expected result : a new row with cells inheriting the class attribute from the previous line actual result : a new row without class attributes
Very interesting, indeed.
Updated•17 years ago
|
QA Contact: bugzilla → editor
Updated•17 years ago
|
Assignee: mozeditor → nobody
Assignee | ||
Comment 3•16 years ago
|
||
This patch add a new method on nsITableEditor void insertTableRowExt(in long aNumber, in boolean aAfter, in boolean aSameStyleAndType, in boolean aSameColSpan, in boolean aPreserveRowSpan); So we can says if the new row will add same style, same colspan on its cell, and if it preserves rowspan. And this method is called when we hit the tab key in the editor, instead of insertTableRow.
Attachment #353688 -
Flags: review?(daniel)
Updated•16 years ago
|
Attachment #353688 -
Flags: review?(daniel) → review+
Comment on attachment 353688 [details] [diff] [review] Patch to add a new method insertTableRowExt >+ /** >+ * Insert relative to the selected cell or the >+ * cell enclosing the selection anchor >+ * The selection is collapsed and is left in the new cell >+ * at the same row,col location as the original anchor cell >+ * >+ * @param aNumber Number of items to insert >+ * @param aAfter If TRUE, insert after the current row, >+ * else insert before current row >+ * @param aSameStyleAndType if TRUE, it generates same cell type (td or th) >+ * and applies same style attributes (style, class, valign...) >+ * @param aSameColSpan if TRUE, colspan are preserved >+ * @param aPreserveRowSpan if TRUE, rowspan are preserved >+ */ >+ void insertTableRowExt(in long aNumber, in boolean aAfter, >+ in boolean aSameStyleAndType, >+ in boolean aSameColSpan, >+ in boolean aPreserveRowSpan); Why not aPreserveStyleAndType, aPreserveColSpan and aPreserveRowSpan ? >@@ -1414,17 +1414,17 @@ NS_IMETHODIMP nsHTMLEditor::TabInTable(P > return NS_OK; > } > } while (!iter->IsDone()); > > if (!(*outHandled) && !inIsShift) > { > // if we havent handled it yet then we must have run off the end of > // the table. Insert a new row. >- res = InsertTableRow(1, PR_TRUE); >+ res = InsertTableRowExt(1, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE); Right, this is the only place where we want this thange for the time being. Clients of this code like Thunderbird or Composer/BlueGriffon will decide by themselves if they want to change their "Insert Row above/below" calls. >+ >+ // The list of cell to "duplicate". >+ nsVoidArray cellList; "The list of cells" >+ cellsInRow ++; cellsInRow++; please with no whitespace >+ if (!aPreserveRowSpan) { >+ SetRowSpan(curCell, actualRowSpan); >+ } >+ else >+ checkColSpan = PR_FALSE; Please invert the two cases and base the test on aPreserveRowSpan. >+ cellsInRow ++; cellInRow++ >+ for (i=0; i < actualColSpan; i++) { >+ cellList.AppendElement((void*)curCell.get()); >+ } i = 0; >+ cellPtr->GetAttribute(NS_LITERAL_STRING("valign"), attr); >+ if (!attr.IsEmpty()) >+ newCell->SetAttribute(NS_LITERAL_STRING("valign"), attr); >+ else >+ // we remove the valign attribute added by CreateElementWithDefaults >+ newCell->RemoveAttribute(NS_LITERAL_STRING("valign")); Same as above. >+ cellPtr->GetAttribute(NS_LITERAL_STRING("style"), attr); >+ if (!attr.IsEmpty()) >+ newCell->SetAttribute(NS_LITERAL_STRING("style"), attr); >+ else >+ // we remove the style attribute added by CreateElementWithDefaults >+ newCell->RemoveAttribute(NS_LITERAL_STRING("style")); Same as above. r=me provided the requested changes are made
Assignee | ||
Comment 5•16 years ago
|
||
it adresses glazou's comments, and adds an improvement : attributes of the duplicated tr element were not copied on the new tr element. This is why I ask a new review :-)
Attachment #353688 -
Attachment is obsolete: true
Attachment #356522 -
Flags: review?(daniel)
Reporter | ||
Comment 6•6 years ago
|
||
NI myself to remind me of checking if this bug is still valid.
Flags: needinfo?(pascalc)
Reporter | ||
Updated•3 years ago
|
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(pascalc)
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•