- omit the margin and padding boxes for display types where they are ignored
- use CSS instead of properties for table spacing and padding as suggested by Tim H.
* WebInspector/webInspector/inspector.css: Added rules for spacing and padding.
Added rules that hide the margin and padding boxes (borders and all but the center cell)
when the hide attribute is present.
* WebInspector/webInspector/inspector.html: Added classes for the rules above.
Removed cellpadding and cellspacing attributes.
* WebInspector/webInspector/inspector.js: Added code to hide/show the margin and
padding boxes based on the display type.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15729
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-31 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - omit the margin and padding boxes for display types where they are ignored
+ - use CSS instead of properties for table spacing and padding as suggested by Tim H.
+
+ * WebInspector/webInspector/inspector.css: Added rules for spacing and padding.
+ Added rules that hide the margin and padding boxes (borders and all but the center cell)
+ when the hide attribute is present.
+ * WebInspector/webInspector/inspector.html: Added classes for the rules above.
+ Removed cellpadding and cellspacing attributes.
+ * WebInspector/webInspector/inspector.js: Added code to hide/show the margin and
+ padding boxes based on the display type.
+
2006-07-31 Duncan Wilcox <duncan@mclink.it>
Reviewed by Darin.
color: rgb(255,255,180);
}
+.boxModelTable {
+ border-spacing: 0px;
+}
+
.boxModelTable td {
text-align: center;
min-width: 10px;
+ padding: 0px;
}
.boxModelTable .horizontalCell {
text-align: center;
margin-top: 40%;
}
+
+#marginBoxTable[hide], #paddingBoxTable[hide] {
+ border: 0px
+}
+
+#marginBoxTable[hide] .marginBox, #paddingBoxTable[hide] .paddingBox {
+ display: none
+}
</div>
<div id="metricsPane" class="pane" style="display: none">
<div id="noMetrics" style="display: none">No metrics</div>
- <table class="boxModelTable" id="marginBoxTable" cellpadding=0 cellspacing=0>
- <tr><td valign="top"><div style="position:relative"><div class="boxModelLabel">margin</div></div></td><td id="margin-top"></td><td></td></tr>
- <tr><td class="horizontalCell" id="margin-left"></td><td>
- <table class="boxModelTable" id="borderBoxTable" cellpadding=0 cellspacing=0>
- <tr><td valign="top"><div style="position:relative"><div class="boxModelLabel">border</div></div></td><td id="border-top"></td><td></td></tr>
+ <table class="boxModelTable" id="marginBoxTable">
+ <tr class="marginBox">
+ <td valign="top"><div style="position:relative"><div class="boxModelLabel">margin</div></div></td>
+ <td id="margin-top"></td><td></td></tr>
+ <tr><td class="marginBox horizontalCell" id="margin-left"></td><td>
+ <table class="boxModelTable" id="borderBoxTable">
+ <tr><td valign="top"><div style="position:relative"><div class="boxModelLabel">border</div></div></td>
+ <td id="border-top"></td><td></td></tr>
<tr><td class="horizontalCell" id="border-left"></td><td>
- <table class="boxModelTable" id="paddingBoxTable" cellpadding=0 cellspacing=0>
- <tr><td valign="top"><div style="position:relative"><div class="boxModelLabel">padding</div></div></td><td id="padding-top"></td><td></td></tr>
- <tr><td class="horizontalCell" id="padding-left"></td><td>
- <div id="content"></div></div>
- </td><td class="horizontalCell" id="padding-right"></td></tr>
- <tr><td></td><td id="padding-bottom"></td><td></td></tr>
+ <table class="boxModelTable" id="paddingBoxTable">
+ <tr class="paddingBox">
+ <td valign="top"><div style="position:relative"><div class="boxModelLabel">padding</div></div></td>
+ <td id="padding-top"></td><td></td></tr>
+ <tr><td class="paddingBox horizontalCell" id="padding-left"></td><td>
+ <div id="content"></div>
+ </td><td class="paddingBox horizontalCell" id="padding-right"></td></tr>
+ <tr class="paddingBox"><td></td><td id="padding-bottom"></td><td></td></tr>
</table>
</td><td class="horizontalCell" id="border-right"></td></tr>
<tr><td></td><td id="border-bottom"></td><td></td></tr>
</table>
- </td><td class="horizontalCell" id="margin-right"></td></tr>
- <tr><td></td><td id="margin-bottom"></td><td></td></tr>
+ </td><td class="marginBox horizontalCell" id="margin-right"></td></tr>
+ <tr class="marginBox"><td></td><td id="margin-bottom"></td><td></td></tr>
</table>
</div>
<div id="propertiesPane" class="pane" style="display: none">
"rgba(0, 0, 0, 0)": "transparent",
};
+// Display types for which margin is ignored.
+var noMarginDisplayType = {
+ "table-cell": "no",
+ "table-column": "no",
+ "table-column-group": "no",
+ "table-footer-group": "no",
+ "table-header-group": "no",
+ "table-row": "no",
+ "table-row-group": "no",
+};
+
+// Display types for which padding is ignored.
+var noPaddingDisplayType = {
+ "table-column": "no",
+ "table-column-group": "no",
+ "table-footer-group": "no",
+ "table-header-group": "no",
+ "table-row": "no",
+ "table-row-group": "no",
+};
+
function setUpScrollbar(id)
{
var bar = new AppleVerticalScrollbar(document.getElementById(id));
+ " \u00D7 "
+ style.getPropertyValue("height").replace(/px$/, "");
document.getElementById("content").textContent = size;
+
+ if (noMarginDisplayType[style.display] == "no")
+ document.getElementById("marginBoxTable").setAttribute("hide", "yes");
+ else
+ document.getElementById("marginBoxTable").removeAttribute("hide");
+
+ if (noPaddingDisplayType[style.display] == "no")
+ document.getElementById("paddingBoxTable").setAttribute("hide", "yes");
+ else
+ document.getElementById("paddingBoxTable").removeAttribute("hide");
}
function updatePropertiesPane()