зеркало из https://github.com/mozilla/gecko-dev.git
Bug 748313 part 2 - Always try to use CSS values, even for collapsed selections; r=ehsan
This commit is contained in:
Родитель
6fe3a69d3c
Коммит
ad75957c26
|
@ -6,7 +6,7 @@ load 407256-1.html
|
|||
load 430624-1.html
|
||||
load 459613.html
|
||||
load 475132-1.xhtml
|
||||
asserts-if(!Android,2) load 633709.xhtml # Bug 695364 and bug 671153
|
||||
load 633709.xhtml
|
||||
asserts-if(!Android,6) load 636074-1.html # Bug 439258, charged to the wrong test due to bug 635550
|
||||
load 713427-1.html
|
||||
load 713427-2.xhtml
|
||||
|
|
|
@ -994,8 +994,6 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
|
|||
*aFirst = false;
|
||||
bool first = true;
|
||||
|
||||
bool useCSS = IsCSSEnabled();
|
||||
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
result = GetSelection(getter_AddRefs(selection));
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
|
@ -1023,9 +1021,9 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
|
|||
range->GetStartContainer(getter_AddRefs(collapsedNode));
|
||||
NS_ENSURE_TRUE(collapsedNode, NS_ERROR_FAILURE);
|
||||
bool isSet, theSetting;
|
||||
nsString tOutString;
|
||||
if (aAttribute) {
|
||||
nsString tString(*aAttribute); //MJUDGE SCC NEED HELP
|
||||
nsString tOutString; //MJUDGE SCC NEED HELP
|
||||
nsString tString(*aAttribute);
|
||||
mTypeInState->GetTypingState(isSet, theSetting, aProperty, tString,
|
||||
&tOutString);
|
||||
if (outValue) {
|
||||
|
@ -1038,27 +1036,41 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
|
|||
*aFirst = *aAny = *aAll = theSetting;
|
||||
return NS_OK;
|
||||
}
|
||||
if (!useCSS) {
|
||||
IsTextPropertySetByContent(collapsedNode, aProperty, aAttribute, aValue,
|
||||
isSet, outValue);
|
||||
*aFirst = *aAny = *aAll = isSet;
|
||||
|
||||
if (!isSet && aCheckDefaults) {
|
||||
// style not set, but if it is a default then it will appear if
|
||||
// content is inserted, so we should report it as set (analogous to
|
||||
// TypeInState).
|
||||
PRInt32 index;
|
||||
if (aAttribute && TypeInState::FindPropInList(aProperty, *aAttribute,
|
||||
outValue, mDefaultStyles,
|
||||
index)) {
|
||||
*aFirst = *aAny = *aAll = true;
|
||||
if (outValue) {
|
||||
outValue->Assign(mDefaultStyles[index]->value);
|
||||
}
|
||||
}
|
||||
// Bug 747889: we don't support CSS for fontSize values
|
||||
if ((aProperty != nsEditProperty::font ||
|
||||
!aAttribute->EqualsLiteral("size")) &&
|
||||
mHTMLCSSUtils->IsCSSEditableProperty(collapsedNode, aProperty,
|
||||
aAttribute)) {
|
||||
mHTMLCSSUtils->IsCSSEquivalentToHTMLInlineStyleSet(
|
||||
collapsedNode, aProperty, aAttribute, isSet, tOutString,
|
||||
COMPUTED_STYLE_TYPE);
|
||||
if (outValue) {
|
||||
outValue->Assign(tOutString);
|
||||
}
|
||||
*aFirst = *aAny = *aAll = isSet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
IsTextPropertySetByContent(collapsedNode, aProperty, aAttribute, aValue,
|
||||
isSet, outValue);
|
||||
*aFirst = *aAny = *aAll = isSet;
|
||||
|
||||
if (!isSet && aCheckDefaults) {
|
||||
// style not set, but if it is a default then it will appear if
|
||||
// content is inserted, so we should report it as set (analogous to
|
||||
// TypeInState).
|
||||
PRInt32 index;
|
||||
if (aAttribute && TypeInState::FindPropInList(aProperty, *aAttribute,
|
||||
outValue, mDefaultStyles,
|
||||
index)) {
|
||||
*aFirst = *aAny = *aAll = true;
|
||||
if (outValue) {
|
||||
outValue->Assign(mDefaultStyles[index]->value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// non-collapsed selection
|
||||
|
|
|
@ -435,9 +435,6 @@ const knownFailures = {
|
|||
"QI-Proposed-garbage-1_TEXT-1-dM": true,
|
||||
"QI-Proposed-garbage-1_TEXT-1-body": true,
|
||||
"QI-Proposed-garbage-1_TEXT-1-div": true,
|
||||
"QS-Proposed-B_STRONG-I-1_SC-dM": true,
|
||||
"QS-Proposed-B_STRONG-I-1_SC-body": true,
|
||||
"QS-Proposed-B_STRONG-I-1_SC-div": true,
|
||||
"QS-Proposed-SUB_SPAN.sub-1-SI-dM": true,
|
||||
"QS-Proposed-SUB_SPAN.sub-1-SI-body": true,
|
||||
"QS-Proposed-SUB_SPAN.sub-1-SI-div": true,
|
||||
|
|
Загрузка…
Ссылка в новой задаче