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
HTML List works #1 #1524
Closed
+572
−47
Closed
HTML List works #1 #1524
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
html list implementation
- Loading branch information
commit 4ecbc9a64619d20cedd2c46cf21b546c92973120
| @@ -120,6 +120,10 @@ impl BlockFlow { | ||
| self.float.is_some() | ||
| } | ||
|
|
||
| pub fn is_list(&self) -> bool { | ||
| self.base.listdata.is_some() | ||
| } | ||
|
|
||
| pub fn teardown(&mut self) { | ||
| for box_ in self.box_.iter() { | ||
| box_.teardown(); | ||
| @@ -492,27 +496,41 @@ impl BlockFlow { | ||
| box_.position.set(position); | ||
| } | ||
|
|
||
| /// wrapper of build_display_list. For switching to html list. | ||
| pub fn build_display_list_wrapper<E:ExtraDisplayListData>( | ||
aydinkim
Author
|
||
| &self, | ||
| builder: &DisplayListBuilder, | ||
| dirty: &Rect<Au>, | ||
| offset: Point2D<Au>, | ||
| flow: &Flow, | ||
| list: &RefCell<DisplayList<E>>) { | ||
| if self.is_list() { | ||
| for box_ in self.box_.iter() { | ||
| box_.add_marker_to_display_list(builder, dirty, flow, list) | ||
| } | ||
| } | ||
|
|
||
| // add box that starts block context | ||
| for box_ in self.box_.iter() { | ||
| box_.build_display_list(builder, dirty, offset, flow, list) | ||
| } | ||
| } | ||
|
|
||
| pub fn build_display_list_block<E:ExtraDisplayListData>( | ||
| &mut self, | ||
| builder: &DisplayListBuilder, | ||
| dirty: &Rect<Au>, | ||
| list: &RefCell<DisplayList<E>>) | ||
| -> bool { | ||
| if self.is_float() { | ||
| return self.build_display_list_float(builder, dirty, list); | ||
| } | ||
|
|
||
| let abs_rect = Rect(self.base.abs_position, self.base.position.size); | ||
| if !abs_rect.intersects(dirty) { | ||
| return true; | ||
| } | ||
|
|
||
| debug!("build_display_list_block: adding display element"); | ||
|
|
||
| // add box that starts block context | ||
| for box_ in self.box_.iter() { | ||
| box_.build_display_list(builder, dirty, self.base.abs_position, (&*self) as &Flow, list) | ||
| } | ||
| self.build_display_list_wrapper(builder, dirty, self.base.abs_position, (&*self) as &Flow, list); | ||
|
|
||
| // TODO: handle any out-of-flow elements | ||
| let this_position = self.base.abs_position; | ||
|
|
||
| @@ -536,11 +554,8 @@ impl BlockFlow { | ||
| } | ||
|
|
||
| let offset = self.base.abs_position + self.float.get_ref().rel_pos; | ||
| // add box that starts block context | ||
| for box_ in self.box_.iter() { | ||
| box_.build_display_list(builder, dirty, offset, (&*self) as &Flow, list) | ||
| } | ||
|
|
||
|
|
||
| self.build_display_list_wrapper(builder, dirty, offset, (&*self) as &Flow, list); | ||
|
|
||
| // TODO: handle any out-of-flow elements | ||
|
|
||
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
It seems very odd that we'd need custom display list items for list markers. I don't think this is quite right. Can you explain the design decision here?