lsendel / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Standart conform html mode (doctype) problem #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When i add 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">

or for html 5

<!DOCTYPE html> 

Some strange thinks happens.

1.) Open my test, click on the violet area below the word "test" and watch the 
"Test below" string walking down.

2.) Now drag, move and drop the variables_set block.
And you can see that the window will grow up.

3.) Without the "window.setTimeout" in my demo, the default blocks will looks 
different. Sometimes the text from the elements will float over the element 
borders. A on document ready makes here no different.

But withou doctype / in quirks mode those problems are gone

Original issue reported on code.google.com by henn...@mst.ch on 6 Feb 2013 at 1:18

Attachments:

GoogleCodeExporter commented 8 years ago
Iam still not able to detect the problem.

But i have a work around. 

Add in your css

.blocklyDiv {
    height: 400px;
}

This problem only accures with height: auto at parent div

Because in 

Blockly.svgResize()

The svg element always will set to the size of parent div.
But the div is always 4 higher then the svg object.
Because of this both will grow 4px on each call of   Blockly.svgResize()

But it seams not to be an css issue because i have this behavior even if i use:

      div, svg {
          margin: 0px !important;
          padding: 0px !important;
          border: none !important;
          border-width: 0px !important;
      }

A quick and dirty solution could be in Blockly.svgResize 

if (svg.cachedHeight_ != height && svg.cachedHeight_ != height -4)  {
}

Original comment by henn...@mst.ch on 16 Feb 2013 at 9:36

GoogleCodeExporter commented 8 years ago
All Blockly files now have a doctype.  CSS has been updated accordingly.
See r1084 and r1097.

Original comment by neil.fra...@gmail.com on 16 Jul 2013 at 11:09