зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1539656 - Allow a11y to get list-item ordinal values even when the counter list is dirty without asserting. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D26598 --HG-- extra : amend_source : 1e5bb99c8769b038ce1ee63202191e885f846b18
This commit is contained in:
Родитель
3d1447e056
Коммит
a24fcc8d2b
|
@ -0,0 +1,14 @@
|
|||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var o=document.getElementById('b');
|
||||
o.parentNode.removeChild(o);
|
||||
window.frames[0].document.body.appendChild(document.getElementById('a'));
|
||||
})
|
||||
</script>
|
||||
<ol>
|
||||
<li>
|
||||
<table id='a'>
|
||||
</table>
|
||||
<iframe></iframe>
|
||||
</li>
|
||||
<ul id='b'>
|
|
@ -726,3 +726,4 @@ pref(layout.css.column-span.enabled,true) load 1517033.html
|
|||
pref(layout.css.column-span.enabled,true) load 1517297.html
|
||||
load 1520798-1.xul
|
||||
load 1520798-2.html
|
||||
load 1539656.html
|
||||
|
|
|
@ -6770,6 +6770,7 @@ bool nsBlockFrame::MarkerIsEmpty() const {
|
|||
marker->StyleContent()->ContentCount() == 0;
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
void nsBlockFrame::GetSpokenMarkerText(nsAString& aText) const {
|
||||
const nsStyleList* myList = StyleList();
|
||||
if (myList->GetListStyleImage()) {
|
||||
|
@ -6791,6 +6792,7 @@ void nsBlockFrame::GetSpokenMarkerText(nsAString& aText) const {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void nsBlockFrame::ReflowOutsideMarker(nsIFrame* aMarkerFrame,
|
||||
BlockReflowInput& aState,
|
||||
|
|
|
@ -234,10 +234,12 @@ class nsBlockFrame : public nsContainerFrame {
|
|||
// not 'none', and no 'content'?
|
||||
bool MarkerIsEmpty() const;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
/**
|
||||
* Return the ::marker text equivalent.
|
||||
* Return the ::marker text equivalent, without flushing.
|
||||
*/
|
||||
void GetSpokenMarkerText(nsAString& aText) const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return true if this frame has a ::marker frame.
|
||||
|
|
|
@ -824,11 +824,11 @@ ImgDrawResult nsBulletFrame::PaintBullet(gfxContext& aRenderingContext,
|
|||
aDisableSubpixelAA, this);
|
||||
}
|
||||
|
||||
int32_t nsBulletFrame::Ordinal() const {
|
||||
int32_t nsBulletFrame::Ordinal(bool aDebugFromA11y) const {
|
||||
auto* fc = PresShell()->FrameConstructor();
|
||||
auto* cm = fc->CounterManager();
|
||||
auto* list = cm->CounterListFor(NS_LITERAL_STRING("list-item"));
|
||||
MOZ_ASSERT(list && !list->IsDirty());
|
||||
MOZ_ASSERT(aDebugFromA11y || (list && !list->IsDirty()));
|
||||
nsIFrame* listItem = GetParent()->GetContent()->GetPrimaryFrame();
|
||||
int32_t value = 0;
|
||||
for (auto* node = list->First(); node; node = list->Next(node)) {
|
||||
|
@ -1263,12 +1263,13 @@ nscoord nsBulletFrame::GetLogicalBaseline(WritingMode aWritingMode) const {
|
|||
return ascent + GetLogicalUsedMargin(aWritingMode).BStart(aWritingMode);
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
void nsBulletFrame::GetSpokenText(nsAString& aText) {
|
||||
CounterStyle* style =
|
||||
PresContext()->CounterStyleManager()->ResolveCounterStyle(
|
||||
StyleList()->mCounterStyle);
|
||||
bool isBullet;
|
||||
style->GetSpokenCounterText(Ordinal(), GetWritingMode(), aText, isBullet);
|
||||
style->GetSpokenCounterText(Ordinal(true), GetWritingMode(), aText, isBullet);
|
||||
if (isBullet) {
|
||||
if (!style->IsNone()) {
|
||||
aText.Append(' ');
|
||||
|
@ -1280,6 +1281,7 @@ void nsBulletFrame::GetSpokenText(nsAString& aText) {
|
|||
aText = prefix + aText + suffix;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void nsBulletFrame::RegisterImageRequest(bool aKnownToBeAnimated) {
|
||||
if (mImageRequest) {
|
||||
|
|
|
@ -93,7 +93,9 @@ class nsBulletFrame final : public nsFrame {
|
|||
static void GetListItemText(mozilla::CounterStyle*, mozilla::WritingMode,
|
||||
int32_t aOrdinal, nsAString& aResult);
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
void GetSpokenText(nsAString& aText);
|
||||
#endif
|
||||
|
||||
Maybe<BulletRenderer> CreateBulletRenderer(gfxContext& aRenderingContext,
|
||||
nsPoint aPt);
|
||||
|
@ -112,7 +114,8 @@ class nsBulletFrame final : public nsFrame {
|
|||
}
|
||||
void SetFontSizeInflation(float aInflation);
|
||||
|
||||
int32_t Ordinal() const;
|
||||
// aDebugFromA11y should not be used
|
||||
int32_t Ordinal(bool aDebugFromA11y = false) const;
|
||||
|
||||
already_AddRefed<imgIContainer> GetImage() const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче