From:             taylorms at mtaonline dot net
Operating system: linux 2.6
PHP version:      5.2SVN-2009-11-24 (snap)
PHP Bug Type:     DOM XML related
Bug description:  Output != Input

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 bug report at http://bugs.php.net/?id=50278&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50278&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50278&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50278&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50278&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50278&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50278&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50278&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50278&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50278&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50278&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50278&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50278&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50278&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50278&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50278&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50278&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50278&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50278&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50278&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50278&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50278&r=mysqlcfg

Reply via email to