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 8591758 Details for
Bug 645642
[patch]
Patch v.0
645642.diff (text/plain), 9.17 KB, created by
Simon Montagu :smontagu
(
hide
)
Description:
Patch v.0
Filename:
MIME Type:
Creator:
Simon Montagu :smontagu
Size:
9.17 KB
patch
obsolete
># HG changeset patch ># User Simon Montagu <smontagu@smontagu.org> ># Date 1428941906 -10800 ># Mon Apr 13 19:18:26 2015 +0300 ># Node ID 0f2acdf92a6370712d32a1df65a3e6e803ac22b9 ># Parent bf5d27ef4132a3c34e7fde6b3c8584592c760a52 >Bug 645642: implement text-align: -moz-match-parent > >diff --git a/layout/style/forms.css b/layout/style/forms.css >--- a/layout/style/forms.css >+++ b/layout/style/forms.css >@@ -476,21 +476,20 @@ input[type="color"]:-moz-system-metric(c > -moz-margin-start: auto; > -moz-margin-end: auto; > box-sizing: border-box; > border: 1px solid grey; > display: block; > } > > /* Try to make RTL <input type='file'> look nicer. */ >-/* TODO: use text-align: match-parent when bug 645642 is fixed. */ > input[type="file"]:-moz-dir(rtl) > xul|label { > -moz-padding-start: 0px; > -moz-padding-end: 5px; >- text-align: right; >+ text-align: -moz-match-parent; > } > > /* radio buttons */ > input[type="radio"] { > -moz-appearance: radio; > margin-block-start: 3px; > margin-block-end: 0px; > -moz-margin-start: 5px; >diff --git a/layout/style/html.css b/layout/style/html.css >--- a/layout/style/html.css >+++ b/layout/style/html.css >@@ -582,16 +582,17 @@ ol { > list-style-type: decimal; > margin-block-start: 1em; > margin-block-end: 1em; > -moz-padding-start: 40px; > } > > li { > display: list-item; >+ text-align: -moz-match-parent; > } > > /* nested lists have no top/bottom margins */ > :-moz-any(ul, ol, dir, menu, dl) ul, > :-moz-any(ul, ol, dir, menu, dl) ol, > :-moz-any(ul, ol, dir, menu, dl) dir, > :-moz-any(ul, ol, dir, menu, dl) menu, > :-moz-any(ul, ol, dir, menu, dl) dl { >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 >@@ -1685,16 +1685,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 >@@ -739,16 +739,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 >@@ -795,25 +796,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
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