Bug 748313 part 2 - Always try to use CSS values, even for collapsed selections; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-05-03 10:09:44 +03:00
Родитель 6fe3a69d3c
Коммит ad75957c26
3 изменённых файлов: 34 добавлений и 25 удалений

Просмотреть файл

@ -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,7 +1036,22 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
*aFirst = *aAny = *aAll = theSetting;
return NS_OK;
}
if (!useCSS) {
// 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;
@ -1059,7 +1072,6 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
}
return NS_OK;
}
}
// non-collapsed selection
nsCOMPtr<nsIContentIterator> iter =

Просмотреть файл

@ -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,