Opened 16 years ago
Closed 12 years ago
#3841 closed Task (fixed)
Filter independent of writer
Reported by: | Garry Yao | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | |
Keywords: | Discussion | Cc: |
Description (last modified by )
The Problem
The current filter system doesn't respect filter rule priority:
When rule A is specified with priority higher than rule B when adding to filter system, what expected is all rules items of A will be applied before rules from B.
Unfortunatelly, the current system doesn't allow this happen: the current behavior is different, in which it only guarantee the priority of the same rule item, so one rule imposed on the parent node could never come later than it's child's rule.
If now we have
- a rule entry in A, said, e.g. remove all empty <p>;
- a rule entry in B, said, e.g. remove empty <a>;
Then there's no way to guarantee both rule's completeness.
The Solution
The reason is due to html filter is tightly binding to writer now, which does not allow it to run rules in multiple times, the rules is applied along with the writing process.
If we isolate the filter system out, it becomes more flexible:
- Allow "parsing once, filtering at will", with each filter rule changing the lightweight dom tree structure on the fly;
- Allow filter to alter node type easily;
- Write the whole document after all filters have applied.
Change History (6)
comment:1 Changed 16 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 16 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 16 years ago by
I don't see this one with good eyes becuase:
- it impacts on the performance.
- it could make things much more complicated.
- it's quite unclear how to define the rules.
- it's unclear when to call the filter (considering that an additional and dedicated filtering pass in the DOM tree is unwanted).
Anyway, still open for discussion.
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Most (if not all) of the solution parts have been targeted and fixed in #9981.
Tight up the description.