Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: Source/core/rendering/RenderVTTCue.h

Issue 873483003: Move WebVTT snap-to-lines layout code to a helper class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 24 matching lines...) Expand all
35 class VTTCueBox; 35 class VTTCueBox;
36 36
37 class RenderVTTCue final : public RenderBlockFlow { 37 class RenderVTTCue final : public RenderBlockFlow {
38 public: 38 public:
39 explicit RenderVTTCue(VTTCueBox*); 39 explicit RenderVTTCue(VTTCueBox*);
40 40
41 virtual void trace(Visitor*) override; 41 virtual void trace(Visitor*) override;
42 private: 42 private:
43 virtual void layout() override; 43 virtual void layout() override;
44 44
45 bool isOutside() const; 45 void adjustForTopAndBottomMarginBorderAndPadding();
46 bool isOverlapping() const;
47 bool shouldSwitchDirection(InlineFlowBox*, LayoutUnit) const;
48
49 void moveBoxesByStep(LayoutUnit);
50 bool switchDirection(bool&, LayoutUnit&);
51
52 bool findFirstLineBox(InlineFlowBox*&);
53 bool initializeLayoutParameters(InlineFlowBox*, LayoutUnit&, LayoutUnit&);
54 void placeBoxInDefaultPosition(LayoutUnit, bool&);
55 void repositionCueSnapToLinesSet();
56 void repositionCueSnapToLinesNotSet(); 46 void repositionCueSnapToLinesNotSet();
57 47
58 RawPtrWillBeMember<VTTCue> m_cue; 48 RawPtrWillBeMember<VTTCue> m_cue;
59 LayoutPoint m_specifiedPosition;
60 }; 49 };
61 50
62 } // namespace blink 51 } // namespace blink
63 52
64 #endif // RenderVTTCue_h 53 #endif // RenderVTTCue_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderVTTCue.cpp » ('j') | Source/core/rendering/RenderVTTCue.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698