Commit Graph

10 Commits

Author SHA1 Message Date
Ting-Yu Lin
14516c6d53 Bug 1321166 - Wrap DetailsFrame's definition and implementation in mozilla namespace. r=dholbert
MozReview-Commit-ID: 24cUKrWKRe
2016-12-01 13:18:03 +08:00
Ting-Yu Lin
cc5f5f88a0 Bug 1304441 Part 3 - Insert main summary's frame construction item at front of the list. r=bz
Change the logic that moves the main summary to the front from operating
on generated frames in DetailsFrame::SetInitialChildList() to operating
on frame construction item list in AddFrameConstructionItemsInternal()
so that it will be correct when cooperating with ::first-line.

The root cause of the bug reported is because when specifying
::first-line on details element, the first frame of summary element,
which is generated due to ib-split, will be wrapped in nsFirstLineFrame.
The original code fails to find the summary frame in the wrapper frame
and triggers assertion because of the second ib-split summary frame. To
fix that, we need to descend into the child list of wrapper frames when
checking the main summary.

Add original test case as a crashtest as well as reftests to clearly
reproduce the issue.

Note that in the reftest, the blue color in ::first-line is applied
incorrectly to the second line in the summary due to bug 520605.

MozReview-Commit-ID: Bv4Vcvxp6pY
2016-10-05 14:43:32 +08:00
Ting-Yu Lin
a4f928106c Bug 1304441 Part 2 - Extract main summary checking code to a function. r=bz
* Change the assertion to non-fatal to make it easier to debug.
* Change the wording per bug 1304441 comment 11.

MozReview-Commit-ID: 1UJXhC4qkrx
2016-10-05 14:43:31 +08:00
Ting-Yu Lin
b5787cd1d4 Bug 1299753 Part 2 - Create block formatting context for DetailsFrame if needed. r=bz
nsCSSFrameConstructor::ConstructNonScrollableBlock() has logic to
determine whether to create a block formatting context for a block
frame. I refactor the function to make it reusable by
nsCSSFrameConstructor::ConstructDetailsFrame().

Also, make NS_NewBlockFrame() accept two arguments as other frame
factory functions so that it could be pointed by BlockFrameCreationFunc.
NS_NewBlockFormattingContext is changed accordingly.

The construction for a scrollable DetailsFrame will be further revised
in Part 3.

MozReview-Commit-ID: 8TwG9YMyGva
2016-09-07 14:45:42 +08:00
Ting-Yu Lin
c1ae09c878 Bug 1258657 Part 2 - Remove SummaryFrame. r=bz
We can use nsBlockFrame to render summary elements.

This change undoes "Bug 591737 - Add SummaryFrame" and remove
summaryFrame usage in DetailsFrame and nsCSSFrameConstructor.

MozReview-Commit-ID: 4aJvHVPfsBb
2016-04-13 13:34:14 +08:00
Ting-Yu Lin
53e6f51184 Bug 1245424 Part 1 - Fix assert for a display:none summary on debug build. r=bz
If the main summary element has 'display: none' style, it won't
generates a summary frame as the first child of the details.

However, if a details element have two summaries and the first summary
has 'display: none', the second summary still generates a SummaryFrame
event if it isn't the main summary. So instead of checking on the
SummaryFrame as before, I check the content tree for the main summary by
using the idea in bug 1245424 comment 8. Another reason might be the
potential removal of SummaryFrame in bug 1258657.

MozReview-Commit-ID: H0evZ17zj5k
2016-03-24 15:05:29 +08:00
Ting-Yu Lin
5a27c483d6 Bug 1225752 - Localize the description of default summary. r=bz 2016-02-04 01:48:00 +08:00
Ting-Yu Lin
fa554e5546 Bug 591737 - Provide a default summary element by DetailsFrame. r=bz
If a <details> lacks a direct <summary> child, we need to construct a
default one.
2016-01-20 23:20:41 +08:00
Ting-Yu Lin
5ec9e745ba Bug 591737 - Construct details and summary in nsCSSFrameConstructor. r=bz 2016-02-02 17:39:49 +08:00
Ting-Yu Lin
9ff24b5e22 Bug 591737 - Add DetailsFrame. r=bz 2016-01-20 23:20:41 +08:00