Closed Bug 162473 Opened 22 years ago Closed 22 years ago

[PATCH] simplify ChangeCSSInlineStyleTxn

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glazou, Assigned: glazou)

References

()

Details

(Keywords: memory-footprint)

Attachments

(1 file, 1 obsolete file)

Bug 60683 has been fixed recently. This bug prevented from assigning inline CSS styles to an element outside of document's tree. Rewriting ChangeCSSInlineStyleTxn to take advantage of that fix - see for instance the URL attached above - should (a) simplify a lot the Do() part of the transaction (b) reduce the size of the strings kept in the txn.
Status: NEW → ASSIGNED
Depends on: 60683
Keywords: footprint
Attached patch patch v1.0 (obsolete) (deleted) — Splinter Review
This patch makes a ChangeCSSInlineStyleTxn keep track only of the values of the requested CSS property before and after txn, instead of keeping track of the values of the whole STYLE attribute. It means that we save A LOT of space. Example : we have a <span style="color:red"> and want to apply to it a blue background. Instead of keeping in the txn the strings "color: red;" and "color: red; background-color: blue; " we now only keep "" and "blue" :-) Thanks to bz who made that possible fixing bug 60683. Kathy, Kin, r/sr please ?
Summary: simplify ChangeCSSInlineStyleTxn → [PATCH] simplify ChangeCSSInlineStyleTxn
Whiteboard: fix in hand, needs r=, needs sr=
Comment on attachment 95095 [details] [diff] [review] patch v1.0 r=brade
Attachment #95095 - Flags: review+
Comment on attachment 95095 [details] [diff] [review] patch v1.0 -- Are you assigning into |result| for debugging purposes? + result = cssDecl->GetPropertyValue(propertyNameString, mRedoValue); return result; -- In your change to UndoTransaction(), you are checking to see if |mRedoValue.IsEmpty()|, should that be |mUndoValue.IsEmpty()|? -- Also the bulk of the code you add in both UndoTransaction() and RedoTransaction() looks the same. Should it be in a utility method? Address the points above and you got an sr=kin@netscape.com.
Attachment #95095 - Flags: superreview+
checked in (trunk)
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Whiteboard: fix in hand, needs r=, needs sr=
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: