commit | eb88a4d2dab7f1312050f2a342daab942731da58 | [log] [tgz] |
---|---|---|
author | Daniel Bratell <bratell@opera.com> | Mon Feb 18 18:41:04 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Feb 18 18:41:04 2019 |
tree | 952c49a8bf7b1b4364167fccb4b807e97a4dd35b | |
parent | f38f665f79deeade8f3ea9e5c17a0e100648a6c5 [diff] |
Rename commonly shadowed kNone + accessibility shadowing fixes In an effort to reduce or even ban variable shadowing, this renames the enum blink::kNone and associated enum values since they are often shadowed by other kNone and kAuto in blink. The patch also renames a couple of other variables to avoid shadowing more locally in modules/accessibility. I'm interested in prohibiting shadowing because I think it might prevent potential jumbo problems. The exact error this avoids is: In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc:29: In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.h:33: In file included from third_party/blink/renderer/core/html/html_area_element.h:29: In file included from third_party/blink/renderer/core/html/html_anchor_element.h:28: In file included from third_party/blink/renderer/core/dom/document.h:43: In file included from third_party/blink/renderer/core/dom/container_node.h:30: In file included from third_party/blink/renderer/core/dom/node.h:36: In file included from third_party/blink/renderer/core/dom/tree_scope.h:33: third_party/blink/renderer/core/layout/hit_test_request.h:38:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kReadOnly = 1 << 1, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:21:3: note: previous declaration is here kReadOnly, ^ In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc:29: In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.h:33: In file included from third_party/blink/renderer/core/html/html_area_element.h:29: In file included from third_party/blink/renderer/core/html/html_anchor_element.h:28: In file included from third_party/blink/renderer/core/dom/document.h:63: In file included from third_party/blink/renderer/core/html/custom/v0_custom_element.h:35: In file included from third_party/blink/renderer/core/html/custom/v0_custom_element_definition.h:35: third_party/blink/renderer/core/html/custom/v0_custom_element_lifecycle_callbacks.h:47:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone = 0, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc:29: In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h:33: In file included from third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h:37: In file included from third_party/blink/renderer/core/layout/api/line_layout_text.h:9: In file included from third_party/blink/renderer/core/frame/local_frame.h:48: In file included from third_party/blink/renderer/core/frame/local_frame_view.h:38: In file included from third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h:33: In file included from third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.h:10: third_party/blink/renderer/platform/graphics/compositing_reasons.h:107:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone = 0, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc:29: In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h:33: In file included from third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h:37: In file included from third_party/blink/renderer/core/layout/api/line_layout_text.h:10: In file included from third_party/blink/renderer/core/layout/api/line_layout_item.h:10: In file included from third_party/blink/renderer/core/layout/layout_object_inlines.h:8: In file included from third_party/blink/renderer/core/css/style_engine.h:45: In file included from third_party/blink/renderer/core/css/resolver/style_resolver.h:31: In file included from third_party/blink/renderer/core/css/element_rule_collector.h:30: In file included from third_party/blink/renderer/core/css/resolver/match_request.h:28: In file included from third_party/blink/renderer/core/css/rule_set.h:28: In file included from third_party/blink/renderer/core/css/css_keyframes_rule.h:30: In file included from third_party/blink/renderer/core/css/style_rule.h:29: In file included from third_party/blink/renderer/core/css/media_list.h:26: third_party/blink/renderer/core/css/media_query.h:48:38: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] enum RestrictorType { kOnly, kNot, kNone }; ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:36: In file included from third_party/blink/renderer/core/editing/editing_utilities.h:32: In file included from third_party/blink/renderer/core/events/input_event.h:12: In file included from third_party/blink/renderer/core/events/ui_event.h:28: third_party/blink/renderer/core/dom/events/event.h:59:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone = 0, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:59: In file included from third_party/blink/renderer/core/html/html_image_element.h:40: third_party/blink/renderer/platform/loader/fetch/fetch_parameters.h:61:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone = 0, // No optimization. ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:92: In file included from third_party/blink/renderer/core/paint/paint_layer.h:63: third_party/blink/renderer/platform/graphics/squashing_disallowed_reasons.h:54:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone = 0, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:105: In file included from third_party/blink/renderer/platform/text/platform_locale.h:33: third_party/blink/renderer/platform/date_components.h:87:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone, // Suppress the second part and the millisecond part if they are 0. ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1335:19: error: declaration shadows a local variable [-Werror,-Wshadow] LayoutObject* layout_object = runner.GetFragment()->GetLayoutObject(); ^ third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1324:23: note: previous declaration is here const LayoutObject& layout_object = *ax_object.GetLayoutObject(); ^ third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1408:19: error: declaration shadows a local variable [-Werror,-Wshadow] LayoutObject* layout_object = runner.GetFragment()->GetLayoutObject(); ^ third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1397:23: note: previous declaration is here const LayoutObject& layout_object = *ax_object.GetLayoutObject(); ^ third_party/blink/renderer/modules/accessibility/ax_node_object.cc:1297:28: error: declaration shadows a local variable [-Werror,-Wshadow] for (HTMLInputElement* radio_button : html_radio_buttons) { ^ third_party/blink/renderer/modules/accessibility/ax_node_object.cc:1294:13: note: previous declaration is here if (auto* radio_button = ToHTMLInputElementOrNull(node_)) { ^ third_party/blink/renderer/modules/accessibility/ax_node_object.cc:3120:25: error: declaration shadows a local variable [-Werror,-Wshadow] ax::mojom::NameFrom name_from; ^ third_party/blink/renderer/modules/accessibility/ax_node_object.cc:3102:54: note: previous declaration is here String AXNodeObject::Description(ax::mojom::NameFrom name_from, ^ In file included from third_party/blink/renderer/modules/accessibility/ax_object.cc:32: third_party/blink/public/platform/web_scroll_into_view_params.h:60:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kAuto = 0, ^ third_party/blink/renderer/platform/geometry/length.h:35:3: note: previous declaration is here kAuto, ^ In file included from third_party/blink/renderer/modules/accessibility/ax_object.cc:49: In file included from third_party/blink/renderer/core/input/event_handler.h:48: third_party/blink/renderer/platform/cursor.h:82:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kNone, ^ third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here kNone = 0, // An object that is not disabled. ^ 14 errors generated. Bug: 923510 Change-Id: Ibe8c325a39c247b018d92c0c97cd95166a4f74be Reviewed-on: https://chromium-review.googlesource.com/c/1477053 Commit-Queue: Kentaro Hara <haraken@chromium.org> Auto-Submit: Daniel Bratell <bratell@opera.com> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#633127}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .