https://bugzilla.wikimedia.org/show_bug.cgi?id=42134

       Web browser: ---
             Bug #: 42134
           Summary: Floated nodes don't get shields in Chrome
           Product: VisualEditor
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: ContentEditable
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---


If you have a floated table inside an alien, it gets a shield (and a phantom)
in Firefox but not in Chrome. This is because the table is floated with
external CSS triggered by class="infobox", rather than an inline style
attribute. At the time when we check for $this.css('float'), $this hasn't been
attached to the main DOM yet. Firefox computes styles on unattached nodes
correctly, but Chrome doesn't.

The solution is to wait until after the entire CE rendering has been built and
attached to the DOM before generating shields and phantoms. Possible
implementations:

1. Add an onAttach function to ce.Node. After attaching, traverse the entire CE
tree and invoke onAttach() on every node (bottom up). This is expensive,
though, because you have to traverse the entire tree just to invoke onAttach on
the few nodes that use it.

2. Make the ce.Surface throw an 'attached' event after attaching to the DOM,
and make the ce.AlienBlockNode constructor listen for this event. This is not
as clean, but more efficient, because only nodes that need processing are
processed.

I have a slight preference for #2, but I can be convinced either way.

In both cases, the call to onUpdate() in the ce.AlienBlockNode constructor
would be removed, otherwise the HTML would be set twice.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to