Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cosmetic resource merging for style selectors #6176

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

antonok-edm
Copy link
Collaborator

@antonok-edm antonok-edm commented Jul 22, 2020

Resolves brave/brave-browser#10862

The issue stems primarily from use of SetPath to update fields in a JSON object; when a CSS selector contains has a . character it is interpreted by SetPath to be a multi-level field access. Using SetKey just treats the . character as part of the key string.

There were previously no tests for merging multiple styles for the same element, an appropriate test has been added.

Submitter Checklist:

Test Plan:

Visit brave://adblock and enter the rule brave.com##.background-gradient1:style(background:#f00 !important) into the "Custom Filters" box. Then, visit https://brave.com. The background of the website should appear as a solid bright red.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@antonok-edm antonok-edm requested a review from emerick July 22, 2020 20:13
@antonok-edm antonok-edm self-assigned this Jul 22, 2020
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antonok-edm antonok-edm added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Jul 22, 2020
@antonok-edm antonok-edm merged commit 1cbdf26 into master Jul 23, 2020
@antonok-edm antonok-edm deleted the fix-cosmetic-style-merge branch July 23, 2020 02:08
@antonok-edm antonok-edm added this to the 1.13.x - Nightly milestone Jul 23, 2020
@antonok-edm antonok-edm removed CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom style cosmetic filter rules for class selectors not applied
2 participants