Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 8599538 Details for
Bug 645642
[patch]
Patch 2: use text-align: -moz-match-parent in <li> and <input type="file">
645642.diff (text/plain), 8.72 KB, created by
Simon Montagu :smontagu
(
hide
)
Description:
Patch 2: use text-align: -moz-match-parent in <li> and <input type="file">
Filename:
MIME Type:
Creator:
Simon Montagu :smontagu
Size:
8.72 KB
patch
obsolete
># HG changeset patch ># User Simon Montagu <smontagu@smontagu.org> ># Date 1430286982 25200 ># Tue Apr 28 22:56:22 2015 -0700 ># Node ID 95e1e30393dbfb913981ee6132fd5b2ae596a36d ># Parent 46591f6b5c554e95f0415e493523db3a6c63cfda >Bug 645642: implement text-align: -moz-match-parent > >diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h >--- a/layout/style/nsCSSKeywordList.h >+++ b/layout/style/nsCSSKeywordList.h >@@ -91,16 +91,17 @@ CSS_KEY(-moz-mac-defaultbuttontext, _moz > CSS_KEY(-moz-mac-focusring, _moz_mac_focusring) > CSS_KEY(-moz-mac-fullscreen-button, _moz_mac_fullscreen_button) > CSS_KEY(-moz-mac-menuselect, _moz_mac_menuselect) > CSS_KEY(-moz-mac-menushadow, _moz_mac_menushadow) > CSS_KEY(-moz-mac-menutextdisable, _moz_mac_menutextdisable) > CSS_KEY(-moz-mac-menutextselect, _moz_mac_menutextselect) > CSS_KEY(-moz-mac-disabledtoolbartext, _moz_mac_disabledtoolbartext) > CSS_KEY(-moz-mac-secondaryhighlight, _moz_mac_secondaryhighlight) >+CSS_KEY(-moz-match-parent, _moz_match_parent) > CSS_KEY(-moz-max-content, _moz_max_content) > CSS_KEY(-moz-menuhover, _moz_menuhover) > CSS_KEY(-moz-menuhovertext, _moz_menuhovertext) > CSS_KEY(-moz-menubartext, _moz_menubartext) > CSS_KEY(-moz-menubarhovertext, _moz_menubarhovertext) > CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline) > CSS_KEY(-moz-min-content, _moz_min_content) > CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext) >diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp >--- a/layout/style/nsCSSProps.cpp >+++ b/layout/style/nsCSSProps.cpp >@@ -1686,16 +1686,17 @@ KTableValue nsCSSProps::kTextAlignKTable > eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, > eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY, > eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER, > eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT, > eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT, > eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT, > eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END, > eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE, >+ eCSSKeyword__moz_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT, > eCSSKeyword_UNKNOWN,-1 > }; > > KTableValue nsCSSProps::kTextAlignLastKTable[] = { > eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO, > eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT, > eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT, > eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, >diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp >--- a/layout/style/nsRuleNode.cpp >+++ b/layout/style/nsRuleNode.cpp >@@ -1789,18 +1789,19 @@ CheckColorCallback(const nsRuleData* aRu > } > > static nsRuleNode::RuleDetail > CheckTextCallback(const nsRuleData* aRuleData, > nsRuleNode::RuleDetail aResult) > { > const nsCSSValue* textAlignValue = aRuleData->ValueForTextAlign(); > if (textAlignValue->GetUnit() == eCSSUnit_Enumerated && >- textAlignValue->GetIntValue() == >- NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT) { >+ (textAlignValue->GetIntValue() == >+ NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT || >+ textAlignValue->GetIntValue() == NS_STYLE_TEXT_ALIGN_MATCH_PARENT)) { > // Promote reset to mixed since we have something that depends on > // the parent. > if (aResult == nsRuleNode::eRulePartialReset) > aResult = nsRuleNode::eRulePartialMixed; > else if (aResult == nsRuleNode::eRuleFullReset) > aResult = nsRuleNode::eRuleFullMixed; > } > >@@ -4207,16 +4208,37 @@ nsRuleNode::ComputeTextData(void* aStart > NS_NOTYETIMPLEMENTED("align string"); > } else if (eCSSUnit_Enumerated == textAlignValue->GetUnit() && > NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT == > textAlignValue->GetIntValue()) { > canStoreInRuleTree = false; > uint8_t parentAlign = parentText->mTextAlign; > text->mTextAlign = (NS_STYLE_TEXT_ALIGN_DEFAULT == parentAlign) ? > NS_STYLE_TEXT_ALIGN_CENTER : parentAlign; >+ } else if (eCSSUnit_Enumerated == textAlignValue->GetUnit() && >+ NS_STYLE_TEXT_ALIGN_MATCH_PARENT == >+ textAlignValue->GetIntValue()) { >+ canStoreInRuleTree = false; >+ uint8_t parentAlign = parentText->mTextAlign; >+ uint8_t parentDirection = >+ aContext->GetParent()->StyleVisibility()->mDirection; >+ switch (parentAlign) { >+ case NS_STYLE_TEXT_ALIGN_DEFAULT: >+ text->mTextAlign = parentDirection == NS_STYLE_DIRECTION_RTL ? >+ NS_STYLE_TEXT_ALIGN_RIGHT : NS_STYLE_TEXT_ALIGN_LEFT; >+ break; >+ >+ case NS_STYLE_TEXT_ALIGN_END: >+ text->mTextAlign = parentDirection == NS_STYLE_DIRECTION_RTL ? >+ NS_STYLE_TEXT_ALIGN_LEFT : NS_STYLE_TEXT_ALIGN_RIGHT; >+ break; >+ >+ default: >+ text->mTextAlign = parentAlign; >+ } > } else { > if (eCSSUnit_Pair == textAlignValue->GetUnit()) { > // Two values were specified, one must be 'true'. > text->mTextAlignTrue = true; > const nsCSSValuePair& textAlignValuePair = textAlignValue->GetPairValue(); > textAlignValue = &textAlignValuePair.mXValue; > if (eCSSUnit_Enumerated == textAlignValue->GetUnit()) { > if (textAlignValue->GetIntValue() == NS_STYLE_TEXT_ALIGN_TRUE) { >diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h >--- a/layout/style/nsStyleConsts.h >+++ b/layout/style/nsStyleConsts.h >@@ -740,16 +740,17 @@ static inline mozilla::css::Side operato > #define NS_STYLE_TEXT_ALIGN_AUTO 7 > #define NS_STYLE_TEXT_ALIGN_MOZ_CENTER 8 > #define NS_STYLE_TEXT_ALIGN_MOZ_RIGHT 9 > #define NS_STYLE_TEXT_ALIGN_MOZ_LEFT 10 > // NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT is only used in data structs; it > // is never present in stylesheets or computed data. > #define NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT 11 > #define NS_STYLE_TEXT_ALIGN_TRUE 12 >+#define NS_STYLE_TEXT_ALIGN_MATCH_PARENT 13 > // Note: make sure that the largest NS_STYLE_TEXT_ALIGN_* value is smaller than > // the smallest NS_STYLE_VERTICAL_ALIGN_* value below! > > // See nsStyleText, nsStyleFont > #define NS_STYLE_TEXT_DECORATION_LINE_NONE 0 > #define NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE NS_FONT_DECORATION_UNDERLINE > #define NS_STYLE_TEXT_DECORATION_LINE_OVERLINE NS_FONT_DECORATION_OVERLINE > #define NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH NS_FONT_DECORATION_LINE_THROUGH >@@ -796,25 +797,25 @@ static inline mozilla::css::Side operato > #define NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT 4 > #define NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START 5 > #define NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END 6 > > // See nsStyleText > // Note: these values pickup after the text-align values because there > // are a few html cases where an object can have both types of > // alignment applied with a single attribute >-#define NS_STYLE_VERTICAL_ALIGN_BASELINE 13 >-#define NS_STYLE_VERTICAL_ALIGN_SUB 14 >-#define NS_STYLE_VERTICAL_ALIGN_SUPER 15 >-#define NS_STYLE_VERTICAL_ALIGN_TOP 16 >-#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 17 >-#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 18 >-#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 19 >-#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 20 >-#define NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE 21 >+#define NS_STYLE_VERTICAL_ALIGN_BASELINE 14 >+#define NS_STYLE_VERTICAL_ALIGN_SUB 15 >+#define NS_STYLE_VERTICAL_ALIGN_SUPER 16 >+#define NS_STYLE_VERTICAL_ALIGN_TOP 17 >+#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 18 >+#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 19 >+#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 20 >+#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 21 >+#define NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE 22 > > // See nsStyleVisibility > #define NS_STYLE_VISIBILITY_HIDDEN 0 > #define NS_STYLE_VISIBILITY_VISIBLE 1 > #define NS_STYLE_VISIBILITY_COLLAPSE 2 > > // See nsStyleText > #define NS_STYLE_TABSIZE_INITIAL 8 >diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js >--- a/layout/style/test/property_database.js >+++ b/layout/style/test/property_database.js >@@ -3291,17 +3291,17 @@ var gCSSProperties = { > invalid_values: [] > }, > "text-align": { > domProp: "textAlign", > inherited: true, > type: CSS_TYPE_LONGHAND, > // don't know whether left and right are same as start > initial_values: [ "start" ], >- other_values: [ "center", "justify", "end" ], >+ other_values: [ "center", "justify", "end", "-moz-match-parent" ], > invalid_values: [ "true", "true true" ] > }, > "-moz-text-align-last": { > domProp: "MozTextAlignLast", > inherited: true, > type: CSS_TYPE_LONGHAND, > initial_values: [ "auto" ], > other_values: [ "center", "justify", "start", "end", "left", "right" ],
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 645642
:
8591758
|
8599537
|
8599538
|
8599539
|
8599542