Closed
Bug 295544
Opened 20 years ago
Closed 20 years ago
Expose more designMode options to web apps
Categories
(Core :: DOM: Editor, enhancement, P1)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.8beta3
People
(Reporter: darin.moz, Assigned: darin.moz)
References
Details
(Whiteboard: [v1 patch checked in])
Attachments
(1 file)
7.41 KB,
patch
|
Brade
:
review+
jst
:
superreview+
benjamin
:
approval1.8b3+
|
Details | Diff | Splinter Review |
Expose more designMode options to web apps
It turns out that a priviledged script using designMode can configure more of
the behaviors of designMode, including:
* The ability to turn off object resizing. It would be great to have access
to nsIHTMLEditor.objectResizingEnabled.
* The ability to turn off the table editing UI. It would be great to have
access to nsIHTMLInlineTableEditor.inlineTableEditingEnabled.
I know that we don't want to expose these interfaces to untrusted script, but
perhaps we could reflect some of these options on nsIDOMNSHTMLDocument alongside
the other design mode methods and attributes.
I think a simple "flags" like attribute that can be used to enable/disable
capabilities per document would be nice. It looks like it should be easy enough
to implement this in nsHTMLDocument.cpp.
Does anyone have any suggestions on what the API should look like?
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta3
Assignee | ||
Comment 1•20 years ago
|
||
s/nsIHTMLEditor/nsIHTMLObjectResizer/ in comment #0
![]() |
||
Comment 2•20 years ago
|
||
I think I'd be ok with a flags attribute (named designModeFlags or something,
perhaps?).
Assignee | ||
Comment 3•20 years ago
|
||
bz: yeah, that's sort of the API i was considering. do we have any other
examples of DOM APIs (for the web) exposing a flags-like getter and setter?
Assignee | ||
Comment 4•20 years ago
|
||
I spoke with jst over IRC about this API, and he suggested that it would be
better to leverage the execCommand API. We can basically follow what he did to
implement insertBrOnReturn.
So, my plan is to add boolean commands named:
enableObjectResizing
enableInlineTableEditing
Does this sound good to everyone?
Assignee | ||
Comment 5•20 years ago
|
||
Attachment #187056 -
Flags: superreview?(jst)
Attachment #187056 -
Flags: review?(brade)
Assignee | ||
Comment 6•20 years ago
|
||
There appears to be a bug that prevents disabling object resizing UI after it
has been shown, but that is a separate bug IMO. Glazman has sent me a patch
that should help with that situation. For now, I want to just get this basic
support in, since it makes it possible to do the following:
doc.designMode = "on";
doc.execCommand("enableObjectResizing", false, "false");
doc.execCommand("enableInlineTableEditing", false, "false");
Then, things seem to work as expected.
Comment 7•20 years ago
|
||
Comment on attachment 187056 [details] [diff] [review]
v1 patch: using execCommand
sr=jst
Attachment #187056 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 8•20 years ago
|
||
I'd really like to see this patch make the Deer Park Alpha 2 train if possible.
Flags: blocking1.8b3?
Flags: blocking-aviary1.1?
Comment 9•20 years ago
|
||
Comment on attachment 187056 [details] [diff] [review]
v1 patch: using execCommand
r=brade (thanks!)
Attachment #187056 -
Flags: review?(brade) → review+
for the record, IBM has used a similar patch I made for them a while ago. Ask
mkaply.
Assignee | ||
Updated•20 years ago
|
Attachment #187056 -
Flags: approval1.8b3?
Comment 11•20 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=294687
add EnableAbsolutePositioning and it's the same patch and more :)
Assignee | ||
Comment 12•20 years ago
|
||
So, should I add the absolute positioning control to this patch then?
Comment 13•20 years ago
|
||
That would be awesome if you can do that. Then I can just dupe my bug to this one.
Assignee | ||
Comment 14•20 years ago
|
||
I don't want this patch to miss the DPA2 train, so how about if I add absolute
positioning as a followup patch? Feel free to mark the other as a dupe.
Comment 15•20 years ago
|
||
*** Bug 294687 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Attachment #187056 -
Flags: approval1.8b3? → approval1.8b3+
Assignee | ||
Comment 16•20 years ago
|
||
The v1 patch is in on the trunk. Leaving this bug open to add the absolute
positioning option.
Assignee | ||
Updated•20 years ago
|
Whiteboard: [v1 patch checked in]
Assignee | ||
Comment 17•20 years ago
|
||
mkaply: "cmd_absPos" already exists for design mode, so i think this bug can
actually be resolved fixed.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 18•20 years ago
|
||
mkaply: actually, it looks like cmd_absPos is not reflected by
nsHTMLDocument::execCommand :-(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 19•20 years ago
|
||
mkaply: I can't figure out what disabling abs positioning in midas provides the
web app developer. There doesn't seem to be any UI that would allow the user to
abs position something. Am I missing something?
Updated•20 years ago
|
Flags: blocking1.8b3?
Flags: blocking1.8b3-
Flags: blocking-aviary1.1?
Assignee | ||
Comment 20•20 years ago
|
||
marking FIXED per discussion with mkaply over IRC.
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•