Fix for 93626. r=aegis, sr=ben

git-svn-id: svn://10.0.0.236/trunk@100375 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com 2001-08-05 18:36:09 +00:00
parent c4d5ec858e
commit 668f8dfda9
6 changed files with 71 additions and 30 deletions

View File

@ -52,6 +52,7 @@ XUL_ATOM(toolbar, "toolbar")
XUL_ATOM(toolbaritem, "toolbaritem")
XUL_ATOM(toolbox, "toolbox")
XUL_ATOM(image, "image")
XUL_ATOM(description, "description")
// The tree atoms
XUL_ATOM(tree, "tree") // The start of a tree view

View File

@ -5528,9 +5528,15 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
rv = NS_NewOutlinerColFrame(aPresShell, &newFrame);
}
// TEXT CONSTRUCTION
else if (aTag == nsXULAtoms::text) {
processChildren = PR_TRUE;
else if (aTag == nsXULAtoms::text || aTag == nsHTMLAtoms::label ||
aTag == nsXULAtoms::description) {
isReplaced = PR_TRUE;
if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) {
nsAutoString value;
if (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value) ==
NS_CONTENT_ATTR_NOT_THERE)
return NS_OK;
}
rv = NS_NewTextBoxFrame(aPresShell, &newFrame);
}
// End of TEXT CONSTRUCTION logic

View File

@ -5528,9 +5528,15 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
rv = NS_NewOutlinerColFrame(aPresShell, &newFrame);
}
// TEXT CONSTRUCTION
else if (aTag == nsXULAtoms::text) {
processChildren = PR_TRUE;
else if (aTag == nsXULAtoms::text || aTag == nsHTMLAtoms::label ||
aTag == nsXULAtoms::description) {
isReplaced = PR_TRUE;
if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) {
nsAutoString value;
if (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value) ==
NS_CONTENT_ATTR_NOT_THERE)
return NS_OK;
}
rv = NS_NewTextBoxFrame(aPresShell, &newFrame);
}
// End of TEXT CONSTRUCTION logic

View File

@ -184,6 +184,12 @@ statusbarpanel {
padding: 0px;
}
/* ::::: Descriptions and Labels ::::::: */
description[disabled="true"], label[disabled="true"] {
color: #8C99AB;
}
/* ::::: miscellaneous ::::: */
.tooltip-label {

View File

@ -5,7 +5,41 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="text-label">
<binding id="text-base">
<implementation>
<property name="disabled" onget="if (this.getAttribute('disabled') == 'true') return true; return false;"
onset="if (val) this.setAttribute('disabled', 'true');
else this.removeAttribute('disabled');
return val;"/>
<property name="value" onget="return this.getAttribute('value');"
onset="this.setAttribute('value', val); return val;"/>
<property name="crop" onget="return this.getAttribute('crop');"
onset="this.setAttribute('crop', val); return val;"/>
</implementation>
</binding>
<binding id="text-label" extends="chrome://global/content/bindings/text.xml#text-base">
<implementation>
<property name="accesskey" onget="return this.getAttribute('accesskey');"
onset="this.setAttribute('accesskey', val); return val;"/>
<property name="control" onget="return this.getAttribute('control');"
onset="this.setAttribute('control', val); return val;"/>
</implementation>
</binding>
<binding id="label-control" extends="chrome://global/content/bindings/text.xml#text-label">
<handlers>
<handler event="click" action="if (this.disabled) return;
var forElementID = this.getAttribute('control');
if (forElementID)
var forElement = document.getElementById(forElementID);
if(forElement)
forElement.focus();
"/>
</handlers>
</binding>
<binding id="text-for" extends="chrome://global/content/bindings/text.xml#text-base">
<handlers>
<handler event="click" action="var forElementID = this.getAttribute('for');
if (forElementID)
@ -16,18 +50,5 @@
</handlers>
</binding>
<binding id="text-editable-display" extends="chrome://global/content/bindings/text.xml#text"/>
<binding id="text-editable-edit" extends="xul:box">
<content>
<xul:hbox flex="1">
<html:input type="text" inherits="value,type,maxlength,disabled,size,readonly"/>
</xul:hbox>
</content>
<handlers>
<handler event="blur" action="this.setAttribute('mode','display');"/>
</handlers>
</binding>
</bindings>

View File

@ -442,31 +442,32 @@ progressmeter {
-moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter");
}
/********** text **********/
/********** label **********/
/* XXXdwh <text> and <html> are deprecated. */
text, spring {
display: inline;
}
html {
label, description, html {
display: block;
}
text[for] {
description {
-moz-binding: url("chrome://global/content/bindings/text.xml#text-base");
}
label {
-moz-binding: url("chrome://global/content/bindings/text.xml#text-label");
}
text[editable="true"] {
-moz-user-select: text;
label[control] {
-moz-binding: url("chrome://global/content/bindings/text.xml#label-control");
}
text[editable="true"],
text[editable="true"][mode="display"] {
-moz-binding: url("chrome://global/content/bindings/text.xml#text-editable-display");
}
text[editable="true"][mode="edit"] {
-moz-binding: url("chrome://global/content/bindings/text.xml#text-editable-edit");
text[for] {
-moz-binding: url("chrome://global/content/bindings/text.xml#text-for");
}
/********** textbox **********/