Fix crash if a site overrides one of our "magic" rules. Make some of the rules

!important, make nsViewportFrame a containing block no matter what the CSS
says. Bug 181692, r=karnaze, sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2002-11-25 23:40:58 +00:00
parent 9d79b70a36
commit ff14aa1c72
6 changed files with 334 additions and 250 deletions

View File

@ -105,6 +105,8 @@ public:
* @see nsLayoutAtoms::viewportFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -633,6 +635,13 @@ ViewportFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::IsPercentageBase(PRBool& aBase) const
{
aBase = PR_TRUE;
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
ViewportFrame::GetFrameName(nsAString& aResult) const

View File

@ -105,6 +105,8 @@ public:
* @see nsLayoutAtoms::viewportFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -633,6 +635,13 @@ ViewportFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::IsPercentageBase(PRBool& aBase) const
{
aBase = PR_TRUE;
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
ViewportFrame::GetFrameName(nsAString& aResult) const

View File

@ -39,7 +39,7 @@
/* blocks */
html, div, map, dt, isindex, *|*:-moz-anonymous-block, *|*:-moz-cell-content {
html, div, map, dt, isindex {
display: block;
}
@ -158,11 +158,6 @@ table {
text-indent: 0;
}
*|*:-moz-table {
display: table;
-moz-box-sizing: border-box; /* XXX do we really want this? */
}
table[align="left"] {
float: left;
}
@ -176,33 +171,6 @@ table[rules] {
border-collapse: collapse;
}
*|*:-moz-table-outer {
display: table;
margin: 0;
padding: 0;
width: 0;
height: 0;
float: inherit;
clear: inherit;
position: inherit;
top: inherit;
right: inherit;
bottom: inherit;
left: inherit;
z-index: inherit;
clip: inherit;
/* background and border should be inherited so that computed style
* (which uses the outer frame) will get the right values for these
* properties. Since the outer frame does not paint, inheriting
* these is OK.
*/
background: inherit;
border: inherit;
-moz-opacity: inherit;
page-break-before: inherit;
page-break-after: inherit;
}
/* make sure backgrounds are inherited in tables -- see bug 4510*/
td, th, tr {
background: inherit;
@ -233,17 +201,11 @@ tr {
vertical-align: inherit;
}
*|*:-moz-table-row {
display: table-row;
}
/* The :-moz-table-column pseudo-element is for extra columns at the end
of a table. */
col, *|*:-moz-table-column {
col {
display: table-column;
}
colgroup, *|*:-moz-table-column-group {
colgroup {
display: table-column-group;
}
@ -262,10 +224,6 @@ tfoot {
vertical-align: middle;
}
*|*:-moz-table-row-group {
display: table-row-group;
}
td {
display: table-cell;
vertical-align: inherit;
@ -280,12 +238,6 @@ th {
padding: 1px;
}
*|*:-moz-table-cell {
display: table-cell;
padding: 1px;
white-space: inherit;
}
/* inlines */
q:before {
@ -351,12 +303,6 @@ abbr[title], acronym[title] {
/* lists */
*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;
}
ul, menu, dir {
display: block;
list-style-type: disc;
@ -456,19 +402,6 @@ noframes {
/* focusable content */
/* links */
*|*:-moz-any-link {
cursor: pointer;
-moz-user-focus: normal;
}
*|*:-moz-any-link:active {
color: red;
}
*|*:-moz-any-link:focus {
-moz-outline: 1px dotted invert;
}
*|*:-moz-any-link:focus img {
-moz-outline: 1px dotted invert;
}
@ -485,51 +418,6 @@ noembed, noscript, param {
display: none;
}
/* magic */
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
display: block;
background-color: inherit;
}
*|*:-moz-scrolled-content {
/* e.g., text inputs, select boxes */
background: inherit;
padding: inherit;
display: inherit;
-moz-box-orient: inherit;
}
*|*:-moz-page, *|*:-moz-page-sequence {
display: block;
background: transparent;
}
*|*:-moz-pagecontent {
display: block;
}
*|*:-moz-pagebreak {
display: -moz-page-break;
}
*|*:-moz-anonymous-positioned-block {
display: block;
position: relative;
top: inherit;
left: inherit;
bottom: inherit;
right: inherit;
z-index: inherit;
clip: inherit;
-moz-opacity: inherit;
}
*|*:-moz-gc-wrapper-block {
display: block;
}
/* emulation of non-standard HTML <marquee> tag */
marquee {
display: block;
@ -547,15 +435,7 @@ marquee[direction="up"], marquee[direction="down"] {
@media print {
* {
cursor: default !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
background-color: #737373 !important;
}
*|*:-moz-any-link, *|*:-moz-any-link img, img[usemap], object[usemap],
*|*:-moz-any-link img, img[usemap], object[usemap],
img[usemap], object[usemap], object, embed, applet, iframe {
-moz-user-focus: none !important;
}
@ -563,5 +443,5 @@ marquee[direction="up"], marquee[direction="down"] {
blink {
text-decoration: none;
}
}

View File

@ -40,6 +40,159 @@
@namespace parsererror url(http://www.mozilla.org/newlayout/xml/parsererror.xml);
/* magic -- some of these rules are important to keep pages from overriding
them
*/
/* Tables */
*|*:-moz-table {
display: table !important;
-moz-box-sizing: border-box; /* XXX do we really want this? */
}
*|*:-moz-table-outer {
display: table !important;
margin: 0;
padding: 0;
width: 0;
height: 0;
float: inherit;
clear: inherit;
position: inherit;
top: inherit;
right: inherit;
bottom: inherit;
left: inherit;
z-index: inherit;
clip: inherit;
/* background and border should be inherited so that computed style
* (which uses the outer frame) will get the right values for these
* properties. Since the outer frame does not paint, inheriting
* these is OK.
*/
background: inherit;
border: inherit;
-moz-opacity: inherit;
page-break-before: inherit;
page-break-after: inherit;
}
*|*:-moz-table-row {
display: table-row !important;
}
/* The :-moz-table-column pseudo-element is for extra columns at the end
of a table. */
*|*:-moz-table-column {
display: table-column !important;
}
*|*:-moz-table-column-group {
display: table-column-group !important;
}
*|*:-moz-table-row-group {
display: table-row-group !important;
}
*|*:-moz-table-cell {
display: table-cell !important;
padding: 1px;
white-space: inherit;
}
/* Lists */
*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;
}
/* Links */
*|*:-moz-any-link {
cursor: pointer;
-moz-user-focus: normal;
}
*|*:-moz-any-link:active {
color: red;
}
*|*:-moz-any-link:focus {
-moz-outline: 1px dotted invert;
}
/* Miscellaneous */
*|*:-moz-anonymous-block, *|*:-moz-cell-content {
display: block !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
display: block !important;
background-color: inherit;
}
*|*:-moz-scrolled-content {
/* e.g., text inputs, select boxes */
background: inherit;
padding: inherit;
display: inherit;
-moz-box-orient: inherit;
}
*|*:-moz-page, *|*:-moz-page-sequence {
display: block !important;
background: transparent;
}
*|*:-moz-pagecontent {
display: block !important;
}
*|*:-moz-pagebreak {
display: -moz-page-break !important;
}
*|*:-moz-anonymous-positioned-block {
display: block !important;
position: relative;
top: inherit;
left: inherit;
bottom: inherit;
right: inherit;
z-index: inherit;
clip: inherit;
-moz-opacity: inherit;
}
*|*:-moz-gc-wrapper-block {
display: block !important;
}
/* Printing */
@media print {
* {
cursor: default !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
background-color: #737373 !important;
}
*|*:-moz-any-link {
-moz-user-focus: none !important;
}
}
/* XML parse error reporting */
parsererror|parsererror {
display: block;
font-family: sans-serif;

View File

@ -39,7 +39,7 @@
/* blocks */
html, div, map, dt, isindex, *|*:-moz-anonymous-block, *|*:-moz-cell-content {
html, div, map, dt, isindex {
display: block;
}
@ -158,11 +158,6 @@ table {
text-indent: 0;
}
*|*:-moz-table {
display: table;
-moz-box-sizing: border-box; /* XXX do we really want this? */
}
table[align="left"] {
float: left;
}
@ -176,33 +171,6 @@ table[rules] {
border-collapse: collapse;
}
*|*:-moz-table-outer {
display: table;
margin: 0;
padding: 0;
width: 0;
height: 0;
float: inherit;
clear: inherit;
position: inherit;
top: inherit;
right: inherit;
bottom: inherit;
left: inherit;
z-index: inherit;
clip: inherit;
/* background and border should be inherited so that computed style
* (which uses the outer frame) will get the right values for these
* properties. Since the outer frame does not paint, inheriting
* these is OK.
*/
background: inherit;
border: inherit;
-moz-opacity: inherit;
page-break-before: inherit;
page-break-after: inherit;
}
/* make sure backgrounds are inherited in tables -- see bug 4510*/
td, th, tr {
background: inherit;
@ -233,17 +201,11 @@ tr {
vertical-align: inherit;
}
*|*:-moz-table-row {
display: table-row;
}
/* The :-moz-table-column pseudo-element is for extra columns at the end
of a table. */
col, *|*:-moz-table-column {
col {
display: table-column;
}
colgroup, *|*:-moz-table-column-group {
colgroup {
display: table-column-group;
}
@ -262,10 +224,6 @@ tfoot {
vertical-align: middle;
}
*|*:-moz-table-row-group {
display: table-row-group;
}
td {
display: table-cell;
vertical-align: inherit;
@ -280,12 +238,6 @@ th {
padding: 1px;
}
*|*:-moz-table-cell {
display: table-cell;
padding: 1px;
white-space: inherit;
}
/* inlines */
q:before {
@ -351,12 +303,6 @@ abbr[title], acronym[title] {
/* lists */
*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;
}
ul, menu, dir {
display: block;
list-style-type: disc;
@ -456,19 +402,6 @@ noframes {
/* focusable content */
/* links */
*|*:-moz-any-link {
cursor: pointer;
-moz-user-focus: normal;
}
*|*:-moz-any-link:active {
color: red;
}
*|*:-moz-any-link:focus {
-moz-outline: 1px dotted invert;
}
*|*:-moz-any-link:focus img {
-moz-outline: 1px dotted invert;
}
@ -485,51 +418,6 @@ noembed, noscript, param {
display: none;
}
/* magic */
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
display: block;
background-color: inherit;
}
*|*:-moz-scrolled-content {
/* e.g., text inputs, select boxes */
background: inherit;
padding: inherit;
display: inherit;
-moz-box-orient: inherit;
}
*|*:-moz-page, *|*:-moz-page-sequence {
display: block;
background: transparent;
}
*|*:-moz-pagecontent {
display: block;
}
*|*:-moz-pagebreak {
display: -moz-page-break;
}
*|*:-moz-anonymous-positioned-block {
display: block;
position: relative;
top: inherit;
left: inherit;
bottom: inherit;
right: inherit;
z-index: inherit;
clip: inherit;
-moz-opacity: inherit;
}
*|*:-moz-gc-wrapper-block {
display: block;
}
/* emulation of non-standard HTML <marquee> tag */
marquee {
display: block;
@ -547,15 +435,7 @@ marquee[direction="up"], marquee[direction="down"] {
@media print {
* {
cursor: default !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
background-color: #737373 !important;
}
*|*:-moz-any-link, *|*:-moz-any-link img, img[usemap], object[usemap],
*|*:-moz-any-link img, img[usemap], object[usemap],
img[usemap], object[usemap], object, embed, applet, iframe {
-moz-user-focus: none !important;
}
@ -563,5 +443,5 @@ marquee[direction="up"], marquee[direction="down"] {
blink {
text-decoration: none;
}
}

View File

@ -40,6 +40,159 @@
@namespace parsererror url(http://www.mozilla.org/newlayout/xml/parsererror.xml);
/* magic -- some of these rules are important to keep pages from overriding
them
*/
/* Tables */
*|*:-moz-table {
display: table !important;
-moz-box-sizing: border-box; /* XXX do we really want this? */
}
*|*:-moz-table-outer {
display: table !important;
margin: 0;
padding: 0;
width: 0;
height: 0;
float: inherit;
clear: inherit;
position: inherit;
top: inherit;
right: inherit;
bottom: inherit;
left: inherit;
z-index: inherit;
clip: inherit;
/* background and border should be inherited so that computed style
* (which uses the outer frame) will get the right values for these
* properties. Since the outer frame does not paint, inheriting
* these is OK.
*/
background: inherit;
border: inherit;
-moz-opacity: inherit;
page-break-before: inherit;
page-break-after: inherit;
}
*|*:-moz-table-row {
display: table-row !important;
}
/* The :-moz-table-column pseudo-element is for extra columns at the end
of a table. */
*|*:-moz-table-column {
display: table-column !important;
}
*|*:-moz-table-column-group {
display: table-column-group !important;
}
*|*:-moz-table-row-group {
display: table-row-group !important;
}
*|*:-moz-table-cell {
display: table-cell !important;
padding: 1px;
white-space: inherit;
}
/* Lists */
*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;
}
/* Links */
*|*:-moz-any-link {
cursor: pointer;
-moz-user-focus: normal;
}
*|*:-moz-any-link:active {
color: red;
}
*|*:-moz-any-link:focus {
-moz-outline: 1px dotted invert;
}
/* Miscellaneous */
*|*:-moz-anonymous-block, *|*:-moz-cell-content {
display: block !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
display: block !important;
background-color: inherit;
}
*|*:-moz-scrolled-content {
/* e.g., text inputs, select boxes */
background: inherit;
padding: inherit;
display: inherit;
-moz-box-orient: inherit;
}
*|*:-moz-page, *|*:-moz-page-sequence {
display: block !important;
background: transparent;
}
*|*:-moz-pagecontent {
display: block !important;
}
*|*:-moz-pagebreak {
display: -moz-page-break !important;
}
*|*:-moz-anonymous-positioned-block {
display: block !important;
position: relative;
top: inherit;
left: inherit;
bottom: inherit;
right: inherit;
z-index: inherit;
clip: inherit;
-moz-opacity: inherit;
}
*|*:-moz-gc-wrapper-block {
display: block !important;
}
/* Printing */
@media print {
* {
cursor: default !important;
}
*|*:-moz-viewport, *|*:-moz-viewport-scroll, *|*:-moz-canvas {
background-color: #737373 !important;
}
*|*:-moz-any-link {
-moz-user-focus: none !important;
}
}
/* XML parse error reporting */
parsererror|parsererror {
display: block;
font-family: sans-serif;