insertBefore of WBR does not cause reflow

RESOLVED FIXED

Status

()

Core
Layout
RESOLVED FIXED
13 years ago
10 years ago

People

(Reporter: Taral, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

The URL is a bookmarklet that breaks up long links and such to avoid
over-stretching the page. It does so by adding WBR tags to the link text.
However this does not trigger a reflow. Modifying the bookmarklet to add BR tags
instead DOES trigger a reflow.

If the WBR tags are present at initial render time, it renders correctly. Use 

Reproducible: Always
Steps to Reproduce:
1. Go to http://www.yabbse.org/community/index.php?thread=27432
2. Execute bookmarklet.

Actual Results:  
Nothing.

Expected Results:  
Reflow should wrap the link text.
(Reporter)

Comment 1

13 years ago
Created attachment 148315 [details]
Testcase

Created a testcase. After clicking the button, the third table should look like
the second.
(Reporter)

Updated

13 years ago
Keywords: testcase

Comment 2

13 years ago
Created attachment 148352 [details]
testcase

The previous testcase had two elements with id "big", so the <wbr> was being
added in the wrong place.  I also made the testcase work in IE (added a missing
quote) and added a button that forces a relayuot.
Attachment #148315 - Attachment is obsolete: true

Updated

13 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
This should work:

javascript:(function(){var D=document; F(D.body); function F(n){var u,r,c,x; if(n.nodeType==3){ u=n.data.search(/\S{45}/); if(u>=0) { r=n.splitText(u+45); n.parentNode.insertBefore(D.createElement(%22WBR%22),r); } }else if(n.tagName!=%22STYLE%22 && n.tagName!=%22SCRIPT%22){for (c=0;x=n.childNodes[c];++c){F(x);}} } })(); document.body.parentNode.insertBefore(document.body, document.body); void 0;

Credit to Jim Roberts a.k.a. _Jim_ from MozillaZine Forums.

Created attachment 256946 [details] [diff] [review]
Regression tests.
The reflow branch landing fixed this.  Test added to reftest suite.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Depends on: 300030
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.