Closed Bug 1414230 Opened 7 years ago Closed 6 years ago

Clean up markup table lookup code

Categories

(Core :: Disability Access APIs, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: Paolo, Assigned: Paolo)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

From bug 1403231 comment 26:
- mMarkupMaps -> mHTMLMap
- mXULMarkupMaps -> mXULMap
- Replace functions living in a separate file on lambdas
- Consolidate the XULMAP and MARKUPMAP macros
thanks for filing it
Blocks: cleana11y
Priority: -- → P5
Blocks: 1428930
Yura, this bug and in particular the conversion to lambdas may be useful for bug 1428930.

Do you think you may find some time to work on it, or at least provide a starting point?
Flags: needinfo?(yzenevich)
(In reply to :Paolo Amadini from comment #2)
> Yura, this bug and in particular the conversion to lambdas may be useful for
> bug 1428930.
> 
> Do you think you may find some time to work on it, or at least provide a
> starting point?

I think Alex would definitely have feedback, I'm a little swamped right now with DevTools work, moving ni? to him.
Flags: needinfo?(yzenevich) → needinfo?(surkov.alexander)
Cool, thanks for the quick reply!
Bug 1403231#c26 and this bug summary could serve as a starting point, any particular questions I could help to answer to?
Flags: needinfo?(surkov.alexander)
That actually looks enough for someone familiar with modern C++ to start working on this bug.
Comment on attachment 8948394 [details]
Bug 1414230 - Part 1 - Align XUL and HTML markup table names.

https://reviewboard.mozilla.org/r/217868/#review223622


Static analysis found 2 defects in this patch.
 - 2 defects found by clang-tidy

You can run this analysis locally with:
 - `./mach static-analysis check path/to/file.cpp` (C/C++)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: accessible/base/nsAccessibilityService.cpp:1353
(Diff revision 1)
>    if (!eventListenerService)
>      return false;
>  
>    eventListenerService->AddListenerChangeListener(this);
>  
> -  for (uint32_t i = 0; i < ArrayLength(sMarkupMapList); i++)
> +  for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++)

Warning: Use range-based for loop instead [clang-tidy: modernize-loop-convert]

::: accessible/base/nsAccessibilityService.cpp:1357
(Diff revision 1)
>  
> -  for (uint32_t i = 0; i < ArrayLength(sMarkupMapList); i++)
> -    mMarkupMaps.Put(*sMarkupMapList[i].tag, &sMarkupMapList[i]);
> +  for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++)
> +    mHTMLMarkupMap.Put(*sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);
>  
>  #ifdef MOZ_XUL
> -  for (uint32_t i = 0; i < ArrayLength(sXULMapList); i++)
> +  for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++)

Warning: Use range-based for loop instead [clang-tidy: modernize-loop-convert]
Comment on attachment 8948395 [details]
Bug 1414230 - Part 2 - Simplify XUL markup map creation.

https://reviewboard.mozilla.org/r/217870/#review223634

::: accessible/base/nsAccessibilityService.h:74
(Diff revision 1)
>  };
>  
>  #ifdef MOZ_XUL
>  struct XULMarkupMapInfo {
>    nsStaticAtom** tag;
> -  New_Accessible* new_func;
> +  std::function<Accessible*(nsIContent* aContent,

Since the new lambdas are stateless, they are convertible to function pointers, so using `New_Accessible*` here should still work.
Comment on attachment 8948394 [details]
Bug 1414230 - Part 1 - Align XUL and HTML markup table names.

https://reviewboard.mozilla.org/r/217868/#review223676
Attachment #8948394 - Flags: review?(surkov.alexander) → review+
Comment on attachment 8948395 [details]
Bug 1414230 - Part 2 - Simplify XUL markup map creation.

https://reviewboard.mozilla.org/r/217870/#review223702

looks good with me
Attachment #8948395 - Flags: review?(surkov.alexander) → review+
Pushed by paolo.mozmail@amadzone.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d4ed6acdfc6b
Part 1 - Align XUL and HTML markup table names. r=surkov
https://hg.mozilla.org/integration/mozilla-inbound/rev/2de998ec30b0
Part 2 - Simplify XUL markup map creation. r=surkov
https://hg.mozilla.org/mozilla-central/rev/d4ed6acdfc6b
https://hg.mozilla.org/mozilla-central/rev/2de998ec30b0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Assignee: nobody → paolo.mozmail
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: