document.execCommand("StyleWithCSS", null, false)

I downloaded and installed the nightly build of Minefield yesterday
(November 20, 2008) and it appeared that the command
"document.execCommand("StyleWithCSS", null, false) " is not
implemented any more. Even after running it, document.execCommand
(command, null, option) always inserts styles with CSS instead of HTML
tags.

Will this be standard for FireFox 3.1?

Fredrik
0
fjosefsson
11/21/2008 9:47:09 AM
mozilla.dev.apps.firefox 3660 articles. 0 followers. Post Follow

5 Replies
3162 Views

Similar Articles

[PageSpeed] 19
Get it on Google Play
Get it on Apple App Store

fjosefsson@gmail.com wrote:
> I downloaded and installed the nightly build of Minefield yesterday
> (November 20, 2008) and it appeared that the command
> "document.execCommand("StyleWithCSS", null, false) " is not
> implemented any more. Even after running it, document.execCommand
> (command, null, option) always inserts styles with CSS instead of HTML
> tags.

Sounds wrong.  Is there a bug filed?  Or at least a test page showing 
the problem?

-Boris
0
Boris
11/21/2008 3:44:46 PM
On 11/21/08 7:44 AM, Boris Zbarsky wrote:
> fjosefsson@gmail.com wrote:
>> I downloaded and installed the nightly build of Minefield yesterday
>> (November 20, 2008) and it appeared that the command
>> "document.execCommand("StyleWithCSS", null, false) " is not
>> implemented any more. Even after running it, document.execCommand
>> (command, null, option) always inserts styles with CSS instead of HTML
>> tags.
>
> Sounds wrong. Is there a bug filed? Or at least a test page showing the
> problem?
>
I tried to recreate this problem with a test page: 
http://people.mozilla.org/~ctalbert/editor-test.html

But, I couldn't truly recreate this problem. I did find something that 
can mask itself as the problem you described.  Here's what I found:

If you do the following:
1. Click CSS On
2. Click B
3. Type css on <enter>
4. Click CSS Off
5. Click B
6. Type css off <enter>

Then you get proper HTML that you'd expect:
<span style="font-weight: bold;">css on<br><b>css off<br><br></b></span>

If you do the following, you get something else:
1. Click CSS On
2. Click B
3. Type css on <enter>
4. Click CSS Off <enter>
5. Type css off <enter>

Doing this you get:
<span style="font-weight: bold;">css on<br>css off<br><br></span>

And if you change steps 1 & 4, you won't get any CSS insertion.  It 
seems that we don't reset simply on calling 
execCommand("StyleWithCSS"...).  We reset once you call that and then 
send a formatting instruction.  I'm not sure if that is a bug or an 
expected behavior, however.  This behavior happens in both 3.0.x and 
3.1b2pre.  Fjosefsson, is this what you were seeing, or was it something 
else?

Clint
0
Clint
11/25/2008 5:38:28 PM
Clint Talbert wrote:
> And if you change steps 1 & 4, you won't get any CSS insertion.  It 
> seems that we don't reset simply on calling 
> execCommand("StyleWithCSS"...).  We reset once you call that and then 
> send a formatting instruction.

That looks correct.  The CSS setting only affects what the formatting 
instructions do.

-Boris
1
Boris
11/25/2008 7:00:47 PM
On 25 Nov, 18:38, Clint Talbert <ctalb...@mozilla.com> wrote:
> On 11/21/08 7:44 AM, Boris Zbarsky wrote:> fjosefs...@gmail.com wrote:
> >> I downloaded and installed the nightly build of Minefield yesterday
> >> (November 20, 2008) and it appeared that the command
> >> "document.execCommand("StyleWithCSS", null, false) " is not
> >> implemented any more. Even after running it, document.execCommand
> >> (command, null, option) always inserts styles with CSS instead of HTML
> >> tags.
>
> > Sounds wrong. Is there a bug filed? Or at least a test page showing the
> > problem?
>
> I tried to recreate this problem with a test page:http://people.mozilla.o=
rg/~ctalbert/editor-test.html
>
> But, I couldn't truly recreate this problem. I did find something that
> can mask itself as the problem you described. =A0Here's what I found:
>
> If you do the following:
> 1. Click CSS On
> 2. Click B
> 3. Type css on <enter>
> 4. Click CSS Off
> 5. Click B
> 6. Type css off <enter>
>
> Then you get proper HTML that you'd expect:
> <span style=3D"font-weight: bold;">css on<br><b>css off<br><br></b></span=
>
>
> If you do the following, you get something else:
> 1. Click CSS On
> 2. Click B
> 3. Type css on <enter>
> 4. Click CSS Off <enter>
> 5. Type css off <enter>
>
> Doing this you get:
> <span style=3D"font-weight: bold;">css on<br>css off<br><br></span>
>
> And if you change steps 1 & 4, you won't get any CSS insertion. =A0It
> seems that we don't reset simply on calling
> execCommand("StyleWithCSS"...). =A0We reset once you call that and then
> send a formatting instruction. =A0I'm not sure if that is a bug or an
> expected behavior, however. =A0This behavior happens in both 3.0.x and
> 3.1b2pre. =A0Fjosefsson, is this what you were seeing, or was it somethin=
g
> else?
>
> Clint

Thanks for replying!

You did not reproduce my problem.

I have created an .avi file displaying the different behavior of
Minefield and Firefox.
You can get it from http://filer.mallverkstan.se/filer/bug1.zip (3 MB)
(Sorry I couldn't make a flash)

In the film I am doing the exact same thing first in Firefox then in
Minefield.
In Firefox, the formatting is HTML tags.
In Minefield, it is CSS style.

Comment to film: The tags are formatted as XML data which is why they
have the &lt; inserted, and the tag was converted from <b> to
<STRONG> before being shown in the alert().

If this is not the expected behavior, I could file a bug rapport.

// Fredrik
0
fjosefsson
12/2/2008 3:17:39 PM
fjosefsson@gmail.com wrote:
> If this is not the expected behavior, I could file a bug rapport.

I'll note you never responded to my request for either a bug report with 
a testcase or just a test page...

-Boris
0
Boris
12/2/2008 3:56:35 PM
Reply:

Similar Artilces:

Terminology
Hi all, I've been having interesting discussions about this recently, and = thinking about it a lot, so I thought I'd open it up to the wider = engagement community as I thought you might have some insight on this, = particularly the tech evangelists. I have been using "Open Web App" as a term to describe the kinds of web = experiences I am teaching people to create via the Apps documentation on = MDN (https://developer.mozilla.org/en-US/docs/Web/Apps). This includes = stuff like install API, manifests, priviledged APIs, etc. that are = currently only on Firefox ...

"Firefox" or "Gecko"
Hi, In a lot of places in MDN, like in https://developer.mozilla.org/En/DOM/Attr#Deprecated_properties_and_methods one can see a mention of "Starting in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)...". What is in parens is generated by a template. This was relevant when Gecko/Firefox numbers where different, but I'm wondering if this is necessary anymore for webdev-oriented documentation. I think that since Firefox 4, it would be relevant to just write "Starting in Firefox 7..." (even the ".0" can be dropped I think). This i...

Intent to implement and ship: document.execCommand("cut"/"copy")
Summary: We currently disallow programmatic copying and cutting from JS for Web content, which has relied on web sites to rely on Flash in order to copy content to the clipboard. We are planning to relax this restriction to allow this when execCommand is called in response to a user event. This restriction mimics what we do for other APIs, such as FullScreen. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1012662 Link to standard: This is unfortunately not specified very precisely. There is a rough spec here: < https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#miscel...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

session expires in firefox when using mode="sqlserver" cookieless="false"
hi when i uses mode="sqlserver" and cookieless="false" to store session in the sqlserver2005.  The session expires after first login  when jump to any page(click on any link). At seccond login time it doesn't expire.  but Works fine for IE. any one know the solution, Plz help me.  Thanks in advance....

Renaming of "Firefox only" to "Toolkit only"
As discussed on irc, lots of pages have the mention "Firefox only", or "Not in Firefox" [1] [2]. That's not very correct technically, as other apps like XULRunner or Thunderbird are also concerned by the "Firefox only" texts. It was proposed to rename those to "Toolkit only" / "Not in toolkit". Those texts should be templatized for easier management. It was also discussed if pre-toolkit stuff should be supported, but I guess that's another debate ;-) I'm not taking action on this personally, that was to open the d...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

"Firefox for devs"
Daniel Buchner and I were talking about MDN the other day and we noticed = that the front page of MDN does not actually have a useful, discoverable = link about things like Firefox's developer tools. The "Firefox for Devs" image on the front page takes you to a page = listing what's new for developers in the latest Firefox. While that's = interesting, it seems like we should have a page that aggregates = information for web developers who use Firefox. That would include the = "what's new in the latest Firefox" page as well as the Tools page. Does...

the "Windows Live" "Help Center" "does not support" Firefox
Name: ets3rodamar@hotmail.com Email: ets3rodamarathotmaildotcom Product: Minefield Summary: the "Windows Live" "Help Center" "does not support" Firefox Comments: I received the following info when I tried to access the "Help Central" service of "Windows Live" "http://g.live.com/9uxp9en-us/ftr2?productkey=wlhomepage"...: https://account.live.com/error.aspx?errcode=1047&mkt=de-de [quote] Browser wird nicht unterstützt Versuchen Sie, Ihren Browser auf eine neuere Version zu aktualisieren, um sich be...

firefox "bookmarks manager" "bookmarks toolbar" "same order"
I did a web and groups search for the subject line to try to find an answer, but came up dry. I'm running Firefox2 on an XP machine. The problem is this: For some reason, Bookmarks Manager does not list the bookmarks in the same order as the bookmarks toolbar. It used to. How can I make it do it again? "Restore natural order" does nothing. I want the order in Bookmarks Manager to change to reflect the order on the bookmarks toolbar. I used to be able to make a change in Bookmarks Manager and it would immediately be reflected in the bookmarks toolbar and would li...

"False" could not be set on Property "RightToLeft"
I have a data window, created in using DataWindow 2.5. The DW works fine until I place it in an AjaxControlToolkit TabControl. When I place the <dw:WebDataWindowControl ID="WebDataWindowControl1" runat="server" DataWindowObject="dw_object" LibraryList="~/library.pbl" /> I get that error above. When it is outside the TabControl...no error. I even tried to hardcode the property and that did not work either. If this is something I need to call Sybase above, please let me know. I hope it's is not. ...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

"Null" value as "No Data" in Gridview
I have a TextBox in GridView which is filled with database value... whenever the value is "Null" I want the textbox as "No Data" How to do it??? thanks in advance If you are using SQL Server you can do it in your SELECT statement just use isnull(ColumnName,'No Data'). For example:  SELECT isnull(CoName,'No Data') CoName, isnull(CoAddress,'No Address') CoAddress FROM Company Where.... I do not have access to DB.... so I want to do it in gridview... how to do it ???  how u r binding the grid?Thanks and RegardsKrish-I have not fai...

Web resources about - document.execCommand("StyleWithCSS", null, false) - mozilla.dev.apps.firefox

Resources last updated: 11/24/2015 8:34:52 PM