#10537 closed defect (fixed)
Editor has some problem to set custom contentsPreFilters at Chrome
Reported by: | youngho | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | Editor | Version: | 1.4.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If Editor Plugin has a contentsPreFilters, the pre filter doesn't apply at Chrome.
Looks like there is some loading sequence problem with Chrome.
I attached the test case, and the test results are
FF IE Chrome Safari(windows)
O O X O
Attachments (2)
Change History (13)
Changed 11 years ago by
Attachment: | test_ContentPrefiltersPlugin.html added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Owner: | set to bill |
---|
Bill,
Assigning to you for your thoughts. The basic problem is the RichText? widget is instantiated and postCreate() called on it, which in turn does open(), which invokes the load flow of the Editor async, *then* the plugins are iterated over and loaded. Depending on how quick 'open' is, it may finish before the plugins are loaded and thus leading to this issue
One thought I had would be to add a param to RichText? that is a deferred delays the actual setValue() until some external call to it to load it (if the widget was extended), otherwise do nothing. Some sort of optional load deferred to delay setValue until X happens. In this case, the X is loading all the plugins. I'm going to prototype that and see what you think.
-- Jared
comment:3 Changed 11 years ago by
Hmm, it seems like the simpler solution is to just run all the preFilters before even calling open(), by moving the this.inherited()
call in Editor.postCreate() down. Does that work?
Perhaps the Deferred has some performance benefit but I don't think it's worth thinking about.
comment:4 Changed 11 years ago by
You can't call prefilters before open. The way a lot of plugin logic works is it assumes the editor has at least had the document created (if not fully loaded), as they may attach events to it and the like. So far the leats infavise fix I can find is the one I already attached, the one that just delays setting the value until all plugin init has completed (and thus all filters installed via plugins have registered).
comment:5 Changed 11 years ago by
Owner: | changed from bill to Jared Jurkiewicz |
---|
comment:6 Changed 11 years ago by
Milestone: | tbd → 1.5 |
---|
comment:7 Changed 11 years ago by
And yes, I did try moving it. That was my first attempt at a fix, actually, because it did seem the 'simpler' one. Unfortunately due to the plugins being able to bind to the document of the iframe (and some do), it wouldn't work. The editor just hangs up and throws errors if you try the execute-before-open.
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is sone sort of timing window issue. If the content has loaded before all the plugins have registered, then the filter is not applied. I can see the content error quite easily:
Chrome: Prefiltering content. test_ContentPrefiltersPlugin.html:34Content loaded!. test_ContentPrefiltersPlugin.html:36Registered my plugin.
Firefox: Registered my plugin. 3 Filter called: <p> jodo </p> <p> DOJO </p> Content loaded!.
Need to understand/see if there is a way to delay setting the content until all plugins have loaded (and thus filters registered.). Looking further.