Web framework 4
4.6.0 (2025-10-07)
New features
Added the option
IEpubContentProcessingOptions.addTabIndexToMediaElements. When set to true,tabindex="0"is added to non-interactive media elements (e.g., video, audio, img). This improves accessibility for screen reader and keyboard users by enabling focus and interaction with media elements.
Bugfixes
Fixed an issue where certain elements were given
tabindex="-1"when callingIReaderView.focusOnReadingPosition, preventing focus via standard keyboard navigation (e.g., Tab).Fixed an issue where publication content that changed
overflow-xstyling could break reflow due to browsers implicitly settingoverflow-ytoauto.Safari 26: Worked around a TTS bug where text was misinterpreted as SSML, breaking TTS when text included
<,>, or&. We now escape these characters on Safari 26 by default. Disable viaIReadingSystemEngineOptions.platformWorkaroundOptions.escapeXmlInTtsUtterancesOnSafari26 = false.Fixed an issue where modifying the TTS utterance text in
WebSpeechTtsSynthesizer’sonConfigureUtterancecallback could advance the reading position to the end of the segment too early.Fixed an issue where pointer events on a
ReaderViewAnnotationrendered inSingleDocumentScrollRendererreported an incorrectevent.target.frameworkComponent.Fixed an issue where
ITtsUtteranceData.nodeDatareferenced the parent element for elements withalt/alttext(e.g.,<math>withalttext), instead of the element itself.
4.5.0 (2025-08-29)
New features
Added two new options,
injectionPointStartUnprocessedandinjectionPointEndUnprocessed, toIEpubReaderPublicationCustomCssOptions.CSS injected using these options is not affected by
publicationStyleOptions. This is useful for cases such as customizing the::selectionpseudo-element without being overridden by thepaletteoption, for example.
Bugfixes
Fixed an issue where
ReaderViewdid not stay synchronized withSyncMediaPlayerwhen seeking to the end of the timeline.Fixed an issue where a loader briefly disappeared during navigation.
Fixed an issue where
SyncMediaPlayer.setReaderViewSynchronizationWaitBehavior()set toWAIT_OUTSIDE_ADJACENTdid not always allow playback when the timeline position was within the previous or next spread.Fixed an issue where
SelectionChangedEngineEventData.readerDocumentIndexInSpinecould becomenullinstead of0.Fixed an issue where the Promise from
readerView.goTo()in some cases resolved beforereadingPositionwas updated when usingSingleDocumentScrollRenderer. This could causefocusOnReadingPosition()to target the oldreadingPosition.Fixed an issue where reflowing EPUB content into pages could throw an error when elements with
position: absolutewere nested inside inline elements withposition: relative.Fixed an issue where printing a PDF page with
VisiblePage.print()produced a blank page.
4.4.2 (2025-07-25)
Bugfixes
Fixed an issue that prevented EPUB files larger than 4.2 GB from loading correctly.
4.4.1 (2025-07-04)
Bugfixes
Fixed a bug where performing a
goTo()while using theSingleDocumentScrollRenderercould result in areadingPositionthat differed from the one passed togoTo().Fixed an issue where iframes pointing to
httporhttpsURLs would cause the entire content document to become sandboxed, even whenIEpubReaderPublicationOptions.remoteResourcesNonScriptedDocumentsOptions.policyTypewas set toALLOW_ALLorWHITELIST. This prevented embedded YouTube iframes from functioning correctly, for example.
4.4.0 (2025-06-12)
New features
Added new options under
IReaderViewOptions.pageContainerOptions.titleOptionsthat can be used to configure thetitleattribute on page container<iframe>elements.
Bugfixes
Fixed an issue where the CSS at-rules
@container,@layer, and@scopewere not processed correctly.Fixed an issue where
ContentBlockTarget.getCharLength()could return the wrong length.Fixed an issue where element vertical padding sometimes caused vertical overflow scroll in reflowable EPUBs.
Fixed an issue where pages ending with
<br>elements somtimes caused vertical overflow scroll in reflowable EPUBs.
4.3.0 (2025-05-08)
New features
Added the new option
activeElementStylesOverridetoIEpubReaderPublicationOptions.mediaOverlayOptions. It allows you to override the CSS for the active element when playing EPUB MediaOverlays, without being affected bypublicationStyleOptionssuch aspaletteOptions.Added a new option
IPdfReaderPublicationOptions.addColibrioSpecificFragmentSelectorData. Setting it to true will add a new Colibrio specific parameter,colibrio-pagerects, to the Locator’s selector. This allows the selector to represent multiple rectangles. This is useful when adding text selection highlights for example.
Bugfixes
Fixed an issue where
IPublicationStyleOptions.fontSizeScaleFactorhad no effect in some reflowable EPUBs.Fixed an issue where
IEpubReflowPluginOptions.customForcedPageBreakonly worked if all its options was specified.
Improvements
Setting the option
IPublicationStyleOptions.removePublicationDefinedHorizontalPageMarginsto true, will now apply margin removal on more publications where it previously bailed out.Adds
tabindex="0"to overflow scroll elements so that they can be scrolled with the keyboard as required by WCAG.Added
tabindex="0"to<iframe>elements to allow keyboard navigation to focusable elements inside the iframe in Safari.
4.2.1 (2025-04-07)
Bugfixes
Fixed an issue introduced in version
4.2.0whereIPublicationStyleOptions.fontSizeScaleFactorhad no effect in some EPUBs.
4.2.0 (2025-03-26)
New features
Added a new method
setContentSelection()toVisiblePagethat sets the current selection.Added new options,
typographyResetOptions.removePublicationDefinedFontSizesandtypographyResetOptions.removePublicationDefinedLineHeightstoIPublicationStyleOptions.
Bugfixes
Fixed an issue where paragraph text indendation was sometimes applied on fragmented paragraphs.
Fixed an issue where page content with negative margins could appear outside of the page if
IPublicationStyleOptions.removePublicationDefinedHorizontalPageMarginswas true.
Improvements
Fixed the event order when navigating in the SingleDocumentScrollRenderer to make it more consistent with how the other renderers work. The reading position will be updated and the
readingPositionUpdatedevent will fire before thenavigationEndedevent fires.
4.1.0 (2025-02-28)
New features
Added a new option
publicationStyleOptions.removePublicationDefinedHorizontalPageMargins. When enabled, it does a best effort try to remove page margins defined in the publication CSS.Added a new method,
IReaderPublicationNavigation.getNavigationItemById, which returns aReaderPublicationNavigationItemwith the given id.Added new options
publicationStyleOptions.typographyResetOptions, which contains two options to reset font-size and line-height defined by the publication
Bugfixes
Fixed an issue where
syncMediaEndReachedfired inconsistently.Fixed a bug where the
selectionChangedengine event would not fire ifReaderView.setScriptedContentDocumentEventHandlersEnabled(false)had been called.Fixed a bug where CSS background images did not load if the selector for the style rule contained
:beforeof:afterpseudo selectors.Fixed a bug where the result of
ContentPositionTimeline.toSerializedData()changed when passing the same ContentPositionTimeline options but in different order.
Improvements
Improved building TTS SyncMediaTimeline performance.
4.0.0 (2025-02-04) - Changes since 3.12.0
Notable new features
The major release brings many new important features and improvements to the Colibrio Reader Framework.
Here are some of the most notable features.
Document Sectioning for reflowable EPUB content-documents. When enabled, reflowable documents can be split into sections prior to reflowing. This can greatly increase performance for publications with long content documents. You can control where and how often these breaks occur using options of course. We recommend that you enable Document Sectioning as a default.
New mitigation options for horizontally overflowing
tableandmathelements let you wrap these elements in scroll containers. Previously these would have been shrunken to fit the page width, affecting legibility and accessibility. Note that we have changed the default behaviour to scroll instead of shrink. Read more in the Breaking Changes section below.
New features
Added the new option
IEpubContentProcessingOptions.horizontalOverflowMitigationMinFontSize. When a word is too wide to fit on the page, it can either be broken into multiple lines or scaled down. This option sets the minimum font size to scale down to. If scaling is not enough to fit the word, the styleoverflow-wrap: break-word;will also be applied, allowing the word to be broken up over more than one line.Added the new option
IEpubContentProcessingOptions.horizontalOverflowMathMLStrategycontrolling if<math>elements too wide to fit in the page should be scaled down to fit, or horizontally scrollable.Added the new option
IEpubContentProcessingOptions.horizontalOverflowTableStrategycontrolling if table elements too wide to fit in the page should be scaled down to fit, or horizontally scrollable.Added the new option
IEpubContentProcessingOptions.verticalOverflowMitigationStrategycontrolling if a reflowed page should be allowed to vertically scroll if all content does not fit.Added the new option
IEpubReflowOptions.removeBottomMarginsOnFragmentedElementscontrolling if the bottom margin on fragmented elements should be removed or kept.Added the new method
IReaderViewAnnotationLayer.refreshAnnotations()forcing all annotations to be redrawn.Added support for iframes added by scripts in content documents.
The framework modules can now be imported in NodeJS using the ES module
importkeyword. This feature makes the framework compatible with modern build tools.Added the
IEpubContentBlockOptions.attributeNamesThatCreateContentBlocksoption, allowing you to specify which element attribute names should trigger the creation of a ContentBlock for an element.Added a new option
ITextSearchQueryOptions.ignoreDiacritics, allowing searches to match text with or without diacritics.Added
IPdfReaderPublicationOptions.textLayerOptions.customCss, which allows injecting custom CSS into the text layer of PDF pages.Added the Engine Event
copy, which fires when publication content is copied.Added two new options:
IEpubReaderPublicationOptions.allowAudioElementAutoplayandIEpubReaderPublicationOptions.allowVideoElementAutoplay.The following options in
IReaderViewAnnotationOptionsnow supports space-separated class names:containerClassNamepositionClassNamerangeClassName
Added the new option
IPublicationStyleOptions.wordSpacing, allowing modification of word spacing in reflowable EPUB documents.Added the new option
IPublicationStyleOptions.letterSpacing, allowing modification of letter spacing in reflowable EPUB documents.SpreadSwipeRenderernow supports switching from two-page spreads to a single centered page when the EPUB author has configured the document withrendition:page-spread-centerorspread-none.Added the new option
IReaderViewOptions.contentDisplayAreaOptions, controlling how the available display area is utilized by publication content.Added the new method
fetchTimelinePositionstoIContentPositionTimeline.You can now manage ReaderPublication's storage state, such as
localStorageandsessionStoragefor scripted EPUB content documents. UseIReaderPublication.getReaderPublicationStorage().getStorageArea()to get aIReaderPublicationStorageAreathat can be used for adding, updating and removing items from storages.
Bugfixes
Improvements and bugfixes when applying page-breaks inside tables.
Fixed an issue where the reflow engine would fail to properly measure elements that had a transform applied to them, causing inaccurate page-breaks.
Fixed an issue where page-breaks were not applied correctly for pre-formatted text, like code examples.
Fixed an issue where reflow engine did not calculate margin-collapse rules correctly.
Fixed Reflow Engine issues that in some cases caused page breaks to be applied at wrong positions.
Annotation’s rendered positions now updates correctly inside scrolling containers.
Fixed issues that could cause images to get incorrect aspect ratios.
Fixed an issue where parsing the table of contents in an audiobook might fail.
Extra properties in
WpManifestroot where wrongfully removed, they are now kept.Fixed an issue where the
IReaderPublicationOptions.preventDragAndDropActionshad an incorrect default value.Fixed a bug where reading position might not be accurate when navigating to an annotation spanning two pages.
Fixed a bug where
URLSearchParamsdid not work when passingURLSearchParamsto the constructor.Resolved an issue where trailing
<br>elements on a page could cause it to overflow vertically.Fixed an issue where locators pointing to content within fragmented
<table>elements were sometimes incorrect.Updated the behavior of
ISyncMediaTtsTimelineContentTransformationOptions.normalizeQuotationMarkswhen set to true, it now converts all Unicode single quotation mark characters to the U+0027 Apostrophe (') character, while all Unicode double quotation marks continue to be converted to the U+0022 Quotation mark (").Fixed an issue where VoiceOver could move focus into offscreen/hidden content on iOS 18.
Fixed a bug where the “keydown” engine event’s
modifiers.shiftwas false, even if shift was pressed.Fixed an issue where
IEpubContentBlockOptions.attributeNamesThatCreateContentBlocksdid not affect empty elements.Fixed an issue where TTS playback could not be resumed after being paused due to interruption from a screen reader.
IContentLocation.fetchContentResolver()now works correctly for ranges spanning multiple EPUB documents.Fixed an issue where
IVisiblePageData.boundingClientRectsometimes was assignedundefinedFixed an issue with the page shadow animation in the Stack Renderer in iOS 18.3.
Breaking changes
The new options
IEpubReflowOptions.removeBottomMarginsOnFragmentedElementsandIEpubReflowOptions.removeTopMarginsOnFragmentedElementsdefault to true. This may cause content to appear closer to the top and bottom edge of the page compared to previous Colibrio Reader Framework versions. Set these options to false to keep the old behavior.The new options
IEpubContentProcessingOptions.horizontalOverflowMathMLStrategyandIEpubContentProcessingOptions.horizontalOverflowTableStrategydefault toEpubContentOverflowStrategy.SCROLLin order to improve legibility and accessibility. This will introduce horizontal scrolling within the page when the table or math elements do not fit horizontally. Set this option toEpubContentOverflowStrategy.SCALEto keep the old behavior.The new option
IEpubContentProcessingOptions.horizontalOverflowMitigationMinFontSizedefaults to 16 pixels in order to improve accessibility. This may cause long words be broken up over more than one line. Set this option to 0 to keep the old behavior.The new option
IEpubContentProcessingOptions.verticalOverflowMitigationStrategydefaults toEpubContentOverflowStrategy.SCROLLin order to improve accessibility. This will introduce vertical scrolling within a page if not all content fits. Set this option toEpubContentOverflowStrategy.SCALEto keep the old behavior.The event
syncMediaPlayerSeekingwill now contain theISyncMediaTimelinePositionthat was active before the seek. You can still access the target position usingISyncMediaPlayer.getTimelinePosition(). The event that fires when the seek is completed,syncMediaPlayerSeeked, will still contain the target position.IWpEntityData.nameis now anIWpLocalizableStringinstead of anILocalizableString.IWpLinkedResourceData.descriptionis now anIWpLocalizableStringinstead of anILocalizableString.IWpLinkedResourceData.nameis now anIWpLocalizableStringinstead of anILocalizableString.Changed type of
ISyncMediaObjectRef.typefromSyncMediaObjectRefType | stringtoSyncMediaObjectRefType.Changed type of
ISyncMediaTimelineData.mediaObjectRefTypesfrom(SyncMediaObjectRefType | string)[]toSyncMediaObjectRefType[].Changed type of
ISyncMediaTimeline.getMediaObjectRefTypes()from(SyncMediaObjectRefType | string)[]toSyncMediaObjectRefType[].In
IReaderViewOptions,forcePageAspectRatioanddefaultPageAspectRatiohave been removed. UseIReaderViewOptions.contentDisplayAreaOptionsinstead.IContentLocation.fetchNavigationItemReferences()now functions correctly for locator ranges spanning multiple EPUB documents.Fixed a memory leak issue.
Deprecations
The following methods and types have been deprecated in 4.0.0 but will still be fully functional until they are removed in the next major release.
Deprecated
IReaderPublicationNavigationItemData.locator. Please use the navigation item directly with methods that accepts locators instead. For example:IReaderView.goTo(navigationItemData).Deprecated
IReaderPublicationNavigationItem.getLocator(). Please use the navigation item directly with methods that accepts locators instead. For example:IReaderView.goTo(navigationItem).Deprecated
IUnresolvedContentLocation.getLocator().Deprecated
ISyncMediaPlayer.isPlaying(). Please use!isPaused() && isReady()instead.Deprecated
IReaderView.fetchRectsForVisibleContent(). Please useVisiblePage.fetchRectsForVisibleContent().Deprecated
ISyncMediaPlayer.isPlaying. Instead use!ISyncMediaPlayer.isPaused() && ISyncMediaPlayer.isReady().Deprecated
ReadingSystemEngine.setOptions. Please set up all options when callingnew ReadingSystemEngine(options)instead.The option
IRendererOption.ignoreAspectRatiohas been deprecated. It will continue to work until its removal in version5.0.0of the framework. Please useIReaderViewOptions.contentDisplayAreaOptionswithtypeset toContentDisplayAreaType.FILLinstead.
Removed old deprecated methods and types
Removed deprecated property
IZipArchiveInformation.sha1Signature. Please useIZipArchiveInformation.signature.sha1Hashinstead.Removed deprecated method
IPublication.getMediaType(). Please useIPublication.getType()instead.Removed deprecated method
URLUtils.normalizePathnamePercentEncoding(). Please useURLUtils.normalizePathnameEncoding()instead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxPanOffsetHorizontal. Please useIReaderViewOptions.transformManagerOptions.maxPanOffsetHorizontalinstead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxPanOffsetVertical. Please useIReaderViewOptions.transformManagerOptions.maxPanOffsetVerticalinstead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxScaleFactor. Please useIReaderViewOptions.transformManagerOptions.maxScaleFactorinstead.Removed deprecated method
ISyncMediaPlayer.getApproximateElapsedTimeMsForTimelinePosition(). Please useISyncMediaTimeline.getApproximateOffsetMs()instead.Removed deprecated method
IReaderViewTransformManager.zoomToEventPosition(). Please useIReaderViewTransformManager.zoomToClientPosition(event.clientX, event.clientY, scale, ...)instead.
Cleaned up Public API
The following methods and types were only ever meant to be used internally between the different framework modules and have been removed from the public framework API.
MediaFragmentSelectorUtilsEngineEventTargetNodeUtilsPageFlowDirectionRenderableStateIVisiblePageData.pageIndexInReflowedDocumentIVisiblePage.getPageIndexInReflowedDocument()IReaderViewContentRangeChangeCallbacksIEngineEventBusIReadingSystemEngine.getEventBus()IEngineEventDispatcherIReaderViewPropertyTypeMapIReaderViewPropertyChangedListenerIRenderableDocumentPageStreamIReaderDocumentRenderingContextIPageIteratorContentLocationIRenderableDocumentPageIteratorIReaderDocument.createRenderableDocument(),createRenderableDocumentPageIterator(),fetchEstimatedHeight(),fetchEstimatedNumberOfPages()MediaSourceFactoryIMediaSourceFactoryCreateUrlResultISyncMediaObjectRendererRuntimeISyncMediaObjectRenderer.createRuntime()anddestroyRuntime()IRenderer.createRuntime(),destroyRuntime(),getVisiblePagesArea()Many internal engine event constructors and parameters.
Improvements
SpreadSwipeRendererandSinglePageSwipeRendererare now able to use all available display area when displaying publications containing fixed-layout documents with varying dimensions, such as mixed portrait and landscape documents.ContentPositionTimelinemethods are now many times faster.Updated PDF.js to version 4.8.73.
4.0.0 (2025-02-04) - Changes since 4.0.0-rc.5
New features
Added the new method
fetchTimelinePositionstoIContentPositionTimeline.You can now manage ReaderPublication's storage state, such as
localStorageandsessionStoragefor scripted EPUB content documents. UseIReaderPublication.getReaderPublicationStorage().getStorageArea()to get aIReaderPublicationStorageAreathat can be used for adding, updating and removing items from storages.
Improvements
ContentPositionTimelinemethods are now many times faster.Updated PDF.js to version 4.8.73.
Bugfixes
Fixed an issue where
IVisiblePageData.boundingClientRectsometimes was assignedundefined
4.0.0-rc.5 (2024-11-19)
Breaking changes
In
IReaderViewOptions,forcePageAspectRatioanddefaultPageAspectRatiohave been removed. UseIReaderViewOptions.contentDisplayAreaOptionsinstead.
Deprecations
The option
IRendererOption.ignoreAspectRatiohas been deprecated. It will continue to work until its removal in version5.0.0of the framework. Please useIReaderViewOptions.contentDisplayAreaOptionswithtypeset toContentDisplayAreaType.FILLinstead.
New features
Added the new option
IPublicationStyleOptions.wordSpacing, allowing modification of word spacing in reflowable EPUB documents.Added the new option
IPublicationStyleOptions.letterSpacing, allowing modification of letter spacing in reflowable EPUB documents.SpreadSwipeRenderernow supports switching from two-page spreads to a single centered page when the EPUB author has configured the document withrendition:page-spread-centerorspread-none.Added the new option
IReaderViewOptions.contentDisplayAreaOptions, controlling how the available display area is utilized by publication content.
Bugfixes
IContentLocation.fetchNavigationItemReferences()now functions correctly for locator ranges spanning multiple EPUB documents.Fixed a memory leak issue.
Fixed an issue where the SingleDocumentScrollRenderer wasn’t horizontally centered correctly in some cases.
Improvements
SpreadSwipeRendererandSinglePageSwipeRendererare now able to use all available display area when displaying publications containing fixed-layout documents with varying dimensions, such as mixed portrait and landscape documents.
4.0.0-rc.4 (2024-10-17)
New features
The following options in
IReaderViewAnnotationOptionsnow supports space-separated class names:containerClassNamepositionClassNamerangeClassName
Bugfixes
Fixed an issue where TTS playback could not be resumed after being paused due to interruption from a screen reader.
IContentLocation.fetchContentResolver()now works correctly for ranges spanning multiple EPUB documents.
4.0.0-rc.3 (2024-10-11)
New Features
Added a new option
ITextSearchQueryOptions.ignoreDiacritics, allowing searches to match text with or without diacritics.Added
IPdfReaderPublicationOptions.textLayerOptions.customCss, which allows injecting custom CSS into the text layer of PDF pages.Added the Engine Event
copy, which fires when publication content is copied.Added two new options:
IEpubReaderPublicationOptions.allowAudioElementAutoplayandIEpubReaderPublicationOptions.allowVideoElementAutoplay.
Bug Fixes
Fixed an issue where VoiceOver could move focus into offscreen/hidden content on iOS 18.
Fixed a bug where the “keydown” engine event’s
modifiers.shiftwas false, even if shift was pressed.Fixed an issue where
IEpubContentBlockOptions.attributeNamesThatCreateContentBlocksdid not affect empty elements.
4.0.0-rc.2 (2024-08-28)
New Features
Added the
IEpubContentBlockOptions.attributeNamesThatCreateContentBlocksoption, allowing you to specify which element attribute names should trigger the creation of a ContentBlock for an element.
Bug Fixes
Resolved an issue where trailing
<br>elements on a page could cause it to overflow vertically.Fixed an issue where locators pointing to content within fragmented
<table>elements were sometimes incorrect.Updated the behavior of
ISyncMediaTtsTimelineContentTransformationOptions.normalizeQuotationMarkswhen set to true, it now converts all Unicode single quotation mark characters to the U+0027 Apostrophe (') character, while all Unicode double quotation marks continue to be converted to the U+0022 Quotation mark (").
4.0.0-rc.1 (2024-06-19)
This release contains all features and fixes from version 3.11.0.
Notable new features
The major release brings many new important features and improvements to the Colibrio Reader Framework.
Here are some of the most notable features.
Document Sectioning for reflowable EPUB content-documents. When enabled, reflowable documents can be split into sections prior to reflowing. This can greatly increase performance for publications with long content documents. You can control where and how often these breaks occur using options of course. We recommend that you enable Document Sectioning as a default.
New mitigation options for horizontally overflowing
tableandmathelements let you wrap these elements in scroll containers. Previously these would have been shrunken to fit the page width, affecting legibility and accessibility. Note that we have changed the default behaviour to scroll instead of shrink. Read more in the Breaking Changes section below.
New features
Added the new option
IEpubContentProcessingOptions.horizontalOverflowMitigationMinFontSize. When a word is too wide to fit on the page, it can either be broken into multiple lines or scaled down. This option sets the minimum font size to scale down to. If scaling is not enough to fit the word, the styleoverflow-wrap: break-word;will also be applied, allowing the word to be broken up over more than one line.Added the new option
IEpubContentProcessingOptions.horizontalOverflowMathMLStrategycontrolling if<math>elements too wide to fit in the page should be scaled down to fit, or horizontally scrollable.Added the new option
IEpubContentProcessingOptions.horizontalOverflowTableStrategycontrolling if table elements too wide to fit in the page should be scaled down to fit, or horizontally scrollable.Added the new option
IEpubContentProcessingOptions.verticalOverflowMitigationStrategycontrolling if a reflowed page should be allowed to vertically scroll if all content does not fit.Added the new option
IEpubReflowOptions.removeBottomMarginsOnFragmentedElementscontrolling if the bottom margin on fragmented elements should be removed or kept.Added the new method
IReaderViewAnnotationLayer.refreshAnnotations()forcing all annotations to be redrawn.Added support for iframes added by scripts in content documents.
The framework modules can now be imported in NodeJS using the ES module
importkeyword. This feature makes the framework compatible with modern build tools.
Bugfixes
Improvements and bugfixes when applying page-breaks inside tables.
Fixed an issue where the reflow engine would fail to properly measure elements that had a transform applied to them, causing inaccurate page-breaks.
Fixed an issue where page-breaks were not applied correctly for pre-formatted text, like code examples.
Fixed an issue where reflow engine did not calculate margin-collapse rules correctly.
Fixed Reflow Engine issues that in some cases caused page breaks to be applied at wrong positions.
Annotation’s rendered positions now updates correctly inside scrolling containers.
Fixed issues that could cause images to get incorrect aspect ratios.
Fixed an issue where parsing the table of contents in an audiobook might fail.
Extra properties in
WpManifestroot where wrongfully removed, they are now kept.Fixed an issue where the
IReaderPublicationOptions.preventDragAndDropActionshad an incorrect default value.Fixed a bug where reading position might not be accurate when navigating to an annotation spanning two pages.
Fixed a bug where
URLSearchParamsdid not work when passingURLSearchParamsto the constructor.
Breaking changes
The new options
IEpubReflowOptions.removeBottomMarginsOnFragmentedElementsandIEpubReflowOptions.removeTopMarginsOnFragmentedElementsdefault to true. This may cause content to appear closer to the top and bottom edge of the page compared to previous Colibrio Reader Framework versions. Set these options to false to keep the old behavior.The new options
IEpubContentProcessingOptions.horizontalOverflowMathMLStrategyandIEpubContentProcessingOptions.horizontalOverflowTableStrategydefault toEpubContentOverflowStrategy.SCROLLin order to improve legibility and accessibility. This will introduce horizontal scrolling within the page when the table or math elements do not fit horizontally. Set this option toEpubContentOverflowStrategy.SCALEto keep the old behavior.The new option
IEpubContentProcessingOptions.horizontalOverflowMitigationMinFontSizedefaults to 16 pixels in order to improve accessibility. This may cause long words be broken up over more than one line. Set this option to 0 to keep the old behavior.The new option
IEpubContentProcessingOptions.verticalOverflowMitigationStrategydefaults toEpubContentOverflowStrategy.SCROLLin order to improve accessibility. This will introduce vertical scrolling within a page if not all content fits. Set this option toEpubContentOverflowStrategy.SCALEto keep the old behavior.The event
syncMediaPlayerSeekingwill now contain theISyncMediaTimelinePositionthat was active before the seek. You can still access the target position usingISyncMediaPlayer.getTimelinePosition(). The event that fires when the seek is completed,syncMediaPlayerSeeked, will still contain the target position.IWpEntityData.nameis now anIWpLocalizableStringinstead of anILocalizableString.IWpLinkedResourceData.descriptionis now anIWpLocalizableStringinstead of anILocalizableString.IWpLinkedResourceData.nameis now anIWpLocalizableStringinstead of anILocalizableString.Changed type of
ISyncMediaObjectRef.typefromSyncMediaObjectRefType | stringtoSyncMediaObjectRefType.Changed type of
ISyncMediaTimelineData.mediaObjectRefTypesfrom(SyncMediaObjectRefType | string)[]toSyncMediaObjectRefType[].Changed type of
ISyncMediaTimeline.getMediaObjectRefTypes()from(SyncMediaObjectRefType | string)[]toSyncMediaObjectRefType[].
Deprecations
The following methods and types have been deprecated in 4.0.0 but will still be fully functional until they are removed in the next major release.
Deprecated
IReaderPublicationNavigationItemData.locator. Please use the navigation item directly with methods that accepts locators instead. For example:IReaderView.goTo(navigationItemData).Deprecated
IReaderPublicationNavigationItem.getLocator(). Please use the navigation item directly with methods that accepts locators instead. For example:IReaderView.goTo(navigationItem).Deprecated
IUnresolvedContentLocation.getLocator().Deprecated
ISyncMediaPlayer.isPlaying(). Please use!isPaused() && isReady()instead.Deprecated
IReaderView.fetchRectsForVisibleContent(). Please useVisiblePage.fetchRectsForVisibleContent().Deprecated
ISyncMediaPlayer.isPlaying. Instead use!ISyncMediaPlayer.isPaused() && ISyncMediaPlayer.isReady().Deprecated
ReadingSystemEngine.setOptions. Please set up all options when callingnew ReadingSystemEngine(options)instead.
Removed old deprecated methods and types
Removed deprecated property
IZipArchiveInformation.sha1Signature. Please useIZipArchiveInformation.signature.sha1Hashinstead.Removed deprecated method
IPublication.getMediaType(). Please useIPublication.getType()instead.Removed deprecated method
URLUtils.normalizePathnamePercentEncoding(). Please useURLUtils.normalizePathnameEncoding()instead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxPanOffsetHorizontal. Please useIReaderViewOptions.transformManagerOptions.maxPanOffsetHorizontalinstead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxPanOffsetVertical. Please useIReaderViewOptions.transformManagerOptions.maxPanOffsetVerticalinstead.Removed deprecated option
IReaderViewPanZoomGestureOptions.maxScaleFactor. Please useIReaderViewOptions.transformManagerOptions.maxScaleFactorinstead.Removed deprecated method
ISyncMediaPlayer.getApproximateElapsedTimeMsForTimelinePosition(). Please useISyncMediaTimeline.getApproximateOffsetMs()instead.Removed deprecated method
IReaderViewTransformManager.zoomToEventPosition(). Please useIReaderViewTransformManager.zoomToClientPosition(event.clientX, event.clientY, scale, ...)instead.
Cleaned up Public API
The following methods and types were only ever meant to be used internally between the different framework modules and have been removed from the public framework API.
MediaFragmentSelectorUtilsEngineEventTargetNodeUtilsPageFlowDirectionRenderableStateIVisiblePageData.pageIndexInReflowedDocumentIVisiblePage.getPageIndexInReflowedDocument()IReaderViewContentRangeChangeCallbacksIEngineEventBusIReadingSystemEngine.getEventBus()IEngineEventDispatcherIReaderViewPropertyTypeMapIReaderViewPropertyChangedListenerIRenderableDocumentPageStreamIReaderDocumentRenderingContextIPageIteratorContentLocationIRenderableDocumentPageIteratorIReaderDocument.createRenderableDocument(),createRenderableDocumentPageIterator(),fetchEstimatedHeight(),fetchEstimatedNumberOfPages()MediaSourceFactoryIMediaSourceFactoryCreateUrlResultISyncMediaObjectRendererRuntimeISyncMediaObjectRenderer.createRuntime()anddestroyRuntime()IRenderer.createRuntime(),destroyRuntime(),getVisiblePagesArea()Many internal engine event constructors and parameters.