Browse Source

Revert "Corrected calculation for 'width: auto' so form elements (or any elements which already have a content_area width greater than 0) use it correctly."

This reverts commit 4ff872731ad0065b0aa08121f3aeb1f13970c322.
Lloyd Weehuizen 13 years ago
parent
commit
f36e4f4b62
1 changed files with 3 additions and 6 deletions
  1. 3 6
      Source/Core/LayoutEngine.cpp

+ 3 - 6
Source/Core/LayoutEngine.cpp

@@ -14,7 +14,7 @@
  *
  *
  * The above copyright notice and this permission notice shall be included in
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  * all copies or substantial portions of the Software.
- *
+ * 
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -417,7 +417,7 @@ void LayoutEngine::FormatElementReplaced(Element* element)
 bool LayoutEngine::FormatElementSpecial(Element* element)
 bool LayoutEngine::FormatElementSpecial(Element* element)
 {
 {
 	static String br("br");
 	static String br("br");
-
+	
 	// Check for a <br> tag.
 	// Check for a <br> tag.
 	if (element->GetTagName() == br)
 	if (element->GetTagName() == br)
 	{
 	{
@@ -464,11 +464,8 @@ void LayoutEngine::BuildBoxWidth(Box& box, Element* element, float containing_bl
 
 
 	// Determine if the element has an automatic width, and if not calculate it.
 	// Determine if the element has an automatic width, and if not calculate it.
 	bool width_auto;
 	bool width_auto;
-	int display_property = element->GetProperty< int >(DISPLAY);
-	if (display_property == DISPLAY_INLINE_BLOCK)
-	{
+	if (content_area.x >= 0)
 		width_auto = false;
 		width_auto = false;
-	}
 	else
 	else
 	{
 	{
 		const Property* width_property = element->GetProperty(WIDTH);
 		const Property* width_property = element->GetProperty(WIDTH);