Closed
Bug 750745
Opened 12 years ago
Closed 12 years ago
Allocate nsLineBoxes from their own presshell arena list
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
Details
Attachments
(3 files, 1 obsolete file)
6.99 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
9.48 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
4.25 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Allocate nsLineBoxes from their own presshell arena list. I think we can just reserve an ID for it and call AllocateFrame/FreeFrame directly. Perhaps we should rename those methods AllocateByID or something?
Comment 1•12 years ago
|
||
Comment on attachment 619940 [details] [diff] [review] wip Does adding nsLineBox_id to the queryframe enumeration have any negative consequences? One that comes to mind: does QueryFrame() now attempt to convert things to lineboxes?
Adding nsLineBox to the frame IDs is a bit confusing, although it would work. I suggest renaming nsPresArena::AllocateByCode to nsPresArena::AllocateByFrameID, and add a separate nsPresArena::AllocateByObjectID that takes a separate enum defined in nsPresArena.h. Make that enum start at NON_FRAME_MARKER. change NON_FRAME_MARKER to be 0x20000000, and allocate a new NON_OBJECT_MARKER at 0x40000000.
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Zack Weinberg (:zwol) from comment #1) > does QueryFrame() now attempt to convert things to lineboxes? http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsQueryFrame.h#258 Something like this wouldn't even compile: nsLineBox* line = do_QueryFrame(aFrame); An explicit call on a frame compiles: void* ptr = aFrame->QueryFrame(nsQueryFrame::nsLineBox_id); but would always return null AFAICT from the macros at the top. It also stands out, and you would have to cast the result to be useful so I'm pretty sure something like that would get caught in review. (since we use do_QueryFrame everywhere else) nsLineBox* line; line->QueryFrame(nsQueryFrame::nsLineBox_id); wouldn't compile since nsLineBox doesn't implement nsQueryFrame or use any of the implementation macros. (In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #2) > Adding nsLineBox to the frame IDs is a bit confusing, although it would work. Fair, but I don't think we have any direct use of the enum values in any QueryFrame usage, we always use do_QueryFrame and macros for that. > I suggest renaming nsPresArena::AllocateByCode to > nsPresArena::AllocateByFrameID, and add a separate > nsPresArena::AllocateByObjectID that takes a separate enum defined in > nsPresArena.h. Make that enum start at NON_FRAME_MARKER. change > NON_FRAME_MARKER to be 0x20000000, and allocate a new NON_OBJECT_MARKER at > 0x40000000. Sounds OK but we also need to add those methods on nsIPresShell (which is already huge). The benefit is it's clearly unrelated to nsQueryFrame from an API point of view. I'll take this path, adding comments about the dependency of the magic numbers in both places.
Assignee | ||
Updated•12 years ago
|
Attachment #619940 -
Attachment is obsolete: true
This path can also be easily extended to the other callers of AllocateMisc. In fact, it's probably worth just converting them all to this scheme now.
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #620346 -
Flags: review?(roc)
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #620347 -
Flags: review?(roc)
Assignee | ||
Comment 7•12 years ago
|
||
https://tbpl.mozilla.org/?usebuildbot=1&tree=Try&rev=d69446dad595
Attachment #620348 -
Flags: review?(roc)
Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #4) > This path can also be easily extended to the other callers of AllocateMisc. > In fact, it's probably worth just converting them all to this scheme now. OK, I've marked those methods @deprecated for now.
Assignee | ||
Comment 9•12 years ago
|
||
There was an unrelated error in the first Try push, here's a better one hopefully: https://tbpl.mozilla.org/?usebuildbot=1&tree=Try&rev=272574ed8c60
Attachment #620346 -
Flags: review?(roc) → review+
Attachment #620347 -
Flags: review?(roc) → review+
Attachment #620348 -
Flags: review?(roc) → review+
Assignee | ||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c44e1693ddd9 https://hg.mozilla.org/integration/mozilla-inbound/rev/a9e44cbf62c2 https://hg.mozilla.org/integration/mozilla-inbound/rev/66e86db0a107
Target Milestone: --- → mozilla15
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c44e1693ddd9 https://hg.mozilla.org/mozilla-central/rev/a9e44cbf62c2 https://hg.mozilla.org/mozilla-central/rev/66e86db0a107
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 1038488
You need to log in
before you can comment on or make changes to this bug.
Description
•