ID:               50278
 User updated by:  taylorms at mtaonline dot net
 Reported By:      taylorms at mtaonline dot net
 Status:           Open
 Bug Type:         DOM XML related
 Operating System: linux 2.6
 PHP Version:      5.2SVN-2009-11-24 (snap)
 New Comment:

Note: I added a <span> tag with a single space in it between the two
<input> tags and it worked OK. The source became

<form action="../search/search.php" method="get" class="searchform">
<input type="text" size="15" name="zoom_query" id="searchbox"/><span>
</span><input type="submit" value="search" id="searchgo"/>
</form>

The <input><span><input> are all still on one single line (3 lines
total), but the space between the searchbox and searchgo elements is
consistent now with all other pages. I'm baffled.


Previous Comments:
------------------------------------------------------------------------

[2009-11-24 04:36:56] taylorms at mtaonline dot net

Description:
------------
Using loadHTML to load a formated HTML template file. I then use the
DOM functions to create new elements before using saveHTML to dump the
entire HTML to the browser.

When loading the .html file directly into the browser, the elements
have correct spacing. When using loadHTML/saveHTML, spacing for a
particular element is different.

I've tracked it down to the following difference. The .html looks as
shown in BLK#1 below, whereas the html generated with loadHTML/saveHTML
is as shown in BLK#2 below.

The newline in the .html file shown in BLK#1 produces a "space" between
the elements in both FF3.5 and IE8 that is missing when the BLK#2 code
is sent.

Reproduce code:
---------------
BLK#1
<form class="searchform" method="get" action="../search/search.php">
        <input id="searchbox" type="text" name="zoom_query" size="15"/>
        <input id="searchgo" type="submit" value="search"/>
</form>

BLK#2
<form action="../search/search.php" method="get" class="searchform">
<input type="text" size="15" name="zoom_query" id="searchbox"/><input
type="submit" value="search" id="searchgo"/>
</form>

NOTE: In BLK#2, the two <input> tags are together on the same line,
i.e., no newline between them.

Expected result:
----------------
The searchbox (textbox) and searchgo (button) are separated by a small
space (about 5 px) when displaying the .html file directly (BLK#1 code).


Actual result:
--------------
When displaying in browser using saveHTML, the space is missing, and
only on this page. This is part of a template file and is identical on
every page of my site. BLK#2 code produces a searchbox and searchgo
button that are touching.

NOTE: I can edit the source directly in FF Firebug, add a single space
or a newline to the code between the two <input> tags and the space
appears as it should be.

The DOM functionality is removing newlines in other places too, but
manifests itself here as a negative visual effect.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50278&edit=1

Reply via email to