Changes between Initial Version and Version 8 of Ticket #6726


Ignore:
Timestamp:
06/13/2018 09:12:59 AM (18 months ago)
Author:
mjethani
Comment:

I've removed the CSS.escape part from this issue.

For most selectors (from generic hiding filters), the escaping would have to be done only once in ElemHide. For selectors from domain-specific filters, it would have to be done on each call to ElemHide.getSelectorsForDomain. It should be OK if we limit it to just replacing { and } as we are doing in ElemHideBase now.

By the way I think we may not need this change, because ElemHideBase can take the script property from the superclass and assign its own selector property based on that (see latest patch if interested); the exceptions can still use the unescaped script property, while the selector property (escaped version of the script property) will be used for CSS injection.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6726

    • Property Cc jsonesen fhd added
    • Property Component changed from Unknown to Core
  • Ticket #6726 – Description

    initial v8  
    1111On the other hand, the escaping of `{` and `}` at the time of filter initialization is a bit misplaced. It should be done at the time of injecting the selector into the document. 
    1212 
    13 I propose that we move the escaping of the selector either directly into the web extension or at least into the `ElemHide` module, which deals directly with CSS selectors (for `ElemHideEmulation` also see #6665). Ideally the escaping would be done with [https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape CSS.escape]. 
     13I propose that we move the escaping of the selector either directly into the web extension or at least into the `ElemHide` module, which deals directly with CSS selectors (for `ElemHideEmulation` also see #6665). Ideally the escaping would be done with [https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape CSS.escape], but for performance reasons. 
    1414 
    1515=== What to change === 
    1616Remove the CSS escaping from `ElemHideBase`. 
    1717 
    18 Add CSS escaping to `ElemHide.getSelectorsForDomain`, preferably using [https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape CSS.escape]. 
     18Add CSS escaping to `ElemHide.getSelectorsForDomain`.